Opened 15 months ago
Closed 15 months ago
#6746 closed defect (fixed)
Animal becomes idle for queued garrison
Reported by: | Langbart | Owned by: | Freagarach |
---|---|---|---|
Priority: | If Time Permits | Milestone: | Alpha 27 |
Component: | Simulation | Keywords: | |
Cc: | Patch: | Phab:D4954 |
Description
to reproduce
- build and select two corrals
- press
ctrl
while keepingshift
pressed,right-click
on the first corral and then on the second corral - make animals, note that the animal from the first corral does not go into the second corral once the first corral is full
expected behavior
- animal goes into the second corral and does not become idle
Attachments (2)
Change History (8)
by , 15 months ago
comment:1 by , 15 months ago
by , 15 months ago
Attachment: | workaround.png added |
---|
comment:3 by , 15 months ago
I suppose move orders don't get cancelled. I'll wait for Freagarach's input.
comment:4 by , 15 months ago
Can't the autoGarrison
check just be removed?
-
binaries/data/mods/public/simulation/components/Trainer.js
a b Trainer.prototype.Item.prototype.Spawn = function() 293 293 createdEnts.push(ent); 294 294 } 295 295 296 if (spawnedEnts.length && !autoGarrison &&cmpRallyPoint)296 if (spawnedEnts.length && cmpRallyPoint) 297 297 for (const com of GetRallyPointCommands(cmpRallyPoint, spawnedEnts)) 298 298 ProcessCommand(this.player, com);
OR
-
binaries/data/mods/public/simulation/components/Trainer.js
a b Trainer.prototype.Item.prototype.Spawn = function() 254 254 // Temporary owner affectation needed for GarrisonHolder checks. 255 255 cmpNewOwnership.SetOwnerQuiet(this.player); 256 256 garrisoned = cmpGarrisonable.Garrison(this.trainer); 257 if (!garrisoned) 258 autoGarrison = false 257 259 cmpNewOwnership.SetOwnerQuiet(INVALID_PLAYER); 258 260 } 259 261 }
comment:5 by , 15 months ago
Owner: | set to |
---|---|
Patch: | → Phab:D4954 |
Very nice! I was annoyed many times by this already. :)
The first fix would lead to the garrison command being given twice, which should not be too bad. This also means that one can task entities to do actions when garrisoned (e.g. mining).
The second fix may be unexpected, since it may be just one that fails to garrison (in the future). (E.g. if some autoresearched tech increases the garrison limit, and the tech is researched the moment the requirements are met, which can be entity requirements met by spawning the entity.)
Hey thanks for the report :) Is this a new bug? I don't we follow chained orders for anything if one of the orders fails. It's hard to know when it makes sense to proceed after a failure.