bugfix: Preserve unit behaviour when transferring assets to allies #1885
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change preserves unit behaviour when a player's assets are transferred to an ally player.
Transferred assets run through the
onCapturelogic, which tells them to idle in order to prevent undesirable circumstances like captured enemy objects continuing counterproductive tasks against the capturing player (e.g. we don't want a Dragon Tank to keep flaming our base when we hijack it). Some of these tasks are somehow preserved anyway, such as construction and capturing, while others are not, such as hacking, moving and attacking.In the retail game, this idle-on-capture logic does not take ally asset transferal into consideration, in which case continued behaviour is always valid and desirable. A player will often want to give some of their units some final tasks before they surrender in order to give their ally a helping hand, such as moving workers to safety or attacking a target. Players especially always want their Hackers to keep on hacking. With this change, such tasks are now maintained as expected when transferred to an ally.
Before
Hackers cease hacking when transferred to an ally
CEASE_HACKING.mp4
Units stop movement and attack orders when transferred to an ally
CEASE_TASKS.mp4
After
Hackers continue hacking when transferred to an ally
CONTINUE_HACKING.mp4
Units continue movement and attack orders when transferred to an ally
CONTINUE_TASKS.mp4