[bug?] destroyedWhenCapturedFrom does not destroy infrastructure when territory is returned to allies during a capital liberation
-
I have an infrastructure unit, the Motor Pool, that is unique to one faction, Arcadia. Arcadia captured Tatarea, an ally's territory, and decided to build a Motor Pool there. Arcadia then went on to liberate said ally's capital and Tatarea was automatically returned to their ally. The Motor Pool being infrastructure, it was also given to Arcadia's ally. It ought to have been destroyed, since the Motor Pool is an Arcadian unique unit and should only be useable by them. Furthermore, because I only had a unit graphic for Arcadia's Motor Pool, and not one for their ally, I continually received the "unit image is missing" error notification and had to force-close the game.
For now I think I will have to simply add a unit graphic for all my faction-specific buildings, and I won't find a workaround, since this kind of occurrence is probably going to be very rare. Ideally though, I'd like it if "destroyedWhenCapturedFrom" didn't have this exception, since it doesn't seem like this is an intended loophole.
-
@elreigh Yes, without seeing the actual XML this is just a guess... but by what you described.... the game is trying to create and then subsequently render the image for an "Allied" Arcadia Motor Pool. The game is attempting to change the "Arcadia Motor Pool" into a unit of the Ally, but since the unit is designed as a national specific unit... it is trying to capture the unit as it is defined.
This is not really a bug. I think it is just how you have designed the units. I have come across the same thing while designing.
The other thing that is causing the conflict is that as Allies the game does not view the changing of the territory when the Capital is liberated as a "Capture" strictly speaking.
Would really have to see your XML to figure it out.