Fix BaseBuilderBotModule.LocomotorsForProducibles.#21665
Conversation
9b85ce9 to
5fb6dce
Compare
|
Based on other usage, looks like I was missing a |
There was a problem hiding this comment.
I ran another AI game and managed to get a crash Attempted to get trait from destroyed object (hand 637 (not in world)) in this function. The log doesn't mention which line specifically
at OpenRA.Mods.Common.Traits.BaseBuilderBotModule.LocomotorsForProducibles(Actor producer)
at OpenRA.Mods.Common.Traits.BaseBuilderBotModule.SetRallyPoint(IBot bot, TraitPair`1 rp) in /OpenRA/OpenRA.Mods.Common/Traits/BotModules/BaseBuilderBotModule.cs:line 310
at about 3:30 the pink ai places rallypoint in innacacible location
|
An IsDead check would likely solve the not in world crash. As to the inaccessible locations, I'm not easily seeing where the production checks are going wrong on that. If anybody who is more familiar with the production aspect of things can see the missing piece please do point it out. |
PunkPun
left a comment
There was a problem hiding this comment.
The issue seems to lie in multiqueue, the ProductionQueue trait being attached to the structure, while we are looking for it on the player actor.
The is dead check seems to be consistently crashing in my test games
Account for per-actor production (e.g. ProductionQueue) and per-player production (e.g. ClassicProductionQueue). This requires resolving the Production and ProductionQueue traits on both the producing actor, and the owning player actor. When setting rally points, check the actor didn't die first.
5fb6dce to
e5401e4
Compare
|
Ah - there is per-player and per-actor queue setups. Okay I've updated the code to account for that and a test run in RA and TD both seems reasonable at a glance now. Also adding a missing Disposed check which will cover us for the case when we decide a rally point needs redoing and queue it for later, but it's died a few ticks later when we actually get around to doing it. I'm feeling better about this version, although not fully confident. |
|
I'm probably quite rusty at this point, but what's the use-case for the first |
I am struggling with the usage of these traits. I probably have this wrong and thus it's dead code. |


Account for per-actor production (e.g. ProductionQueue) and per-player production (e.g. ClassicProductionQueue). This requires resolving the Production and ProductionQueue traits on both the producing actor, and the owning player actor.
When setting rally points, check the actor didn't die first.
Fixes #21663