Skip to content

Fix collection of jobs to warehouses#1882

Merged
Flow86 merged 9 commits intoReturn-To-The-Roots:masterfrom
Flamefire:sendCollectFix
Feb 7, 2026
Merged

Fix collection of jobs to warehouses#1882
Flow86 merged 9 commits intoReturn-To-The-Roots:masterfrom
Flamefire:sendCollectFix

Conversation

@Flamefire
Copy link
Member

@Flamefire Flamefire commented Feb 1, 2026

When the "Collect" option in a warehouse for a job is set the actual job subclass will be created which expects its workplace as the goal, i.e. a nobUsual for most.
In this situtation the goal is the warehouse to which the figure should go which triggers an assertion.

So check that in OrderJob and create a nofPassiveWorker instead similar to the Send option handler.

Contains a bit of #1720 to reduce conflicts

A major role in the misunderstanding was likely the nofBuildingWorker(const Job job, const MapPoint pos, const unsigned char player, nobBaseWarehouse* goalWh) overload (warehouse last) which was never used but looks intended for this case. nofPassiveWorker handles this case already without having to maintain a ctor through the whole hierarchy

Flamefire and others added 9 commits February 2, 2026 11:30
Unify uses of soldier checks in one place.
It is never used and can cause confusion.
`nofPassiveWorker` should be used for transfers to a warehouse.
…ove not used code where goal is nullptr because this can never happen
When the "Collect" option in a warehouse for a job is set the actual job
subclass will be created which expects its workplace as the goal, i.e. a
`nobUsual` for most.
In this situtation the goal is the warehouse to which the figure should
go. So check that in `OrderJob` and create a `nofPassiveWorker` instead
similar to the `Send` option handler.
@Flow86 Flow86 merged commit 5a24dac into Return-To-The-Roots:master Feb 7, 2026
20 checks passed
@Flamefire Flamefire deleted the sendCollectFix branch February 7, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants