Refactor Carry-all logic so that "bringing new unit" and "transferring existing unit" is the same #584
Labels
improvement
Quality of life or general improvement of a game mechanic
refactoring
Refactor work, will not be a new feature immediately, use with caution
Projects
Atm the code has a distinction for carry-all's bringing a new unit (it will spawn a new unit when it is at the destination) - or when transferring an existing unit (it remembers the ID of the unit being transferred, the unit that is being transferred is in a 'sort of dead' state, which is used to make it disappear on the map and not interact with other units/bullets/etc).
I think a better way would be to have a unit always spawned, then make it being transferred. Meaning, when a 'new' unit has to be brought to the map (ie a Harvester to a refinery), it should already be spawned. This makes the "how many harvesters do I have" logic a lot easier too when not having to deal with the weird "new to be spawned unit type" edge case.
And, even better, we might be even be able to make a carry-all to bring over more than 1 unit. Simply by having a vector of unit ids to bring over instead of 1 id. (used for OG Dune 2 reinforcements).
The text was updated successfully, but these errors were encountered: