Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Transporter dangling psActionTarget references #3959

Merged

Conversation

past-due
Copy link
Member

@past-due past-due commented Jul 2, 2024

When a transporter returns to home base (from an active away mission), it is moved offworld by orderUpdateDroid(). (Its properties are reset by missionMoveTransporterOffWorld() and it is moved to the mission list, with its action set to DACTION_NONE.)

The subsequent call to actionUpdateDroid() inside droidUpdate() could then set the transporter's psActionTarget to a remaining enemy structure / unit on the away mission map - despite the fact that it had already been moved "off world".

To fix this, skip further processing of the droid inside droidUpdate() when orderUpdateDroid() returns false (as an indicator that the droid has been moved from its current list).

@past-due past-due added this to the 4.5.1 milestone Jul 2, 2024
When a transporter returns to home base (from an active away mission), it is moved offworld by `orderUpdateDroid()`. (Its properties are reset by `missionMoveTransporterOffWorld()` and it is moved to the mission list, with its action set to `DACTION_NONE`.)

The subsequent call to `actionUpdateDroid()` inside `droidUpdate()` could then set the transporter's `psActionTarget` to a remaining enemy structure / unit on the away mission map - despite the fact that it had already been moved "off world".

To fix this, skip further processing of the droid inside `droidUpdate()` when `orderUpdateDroid()` returns false (as an indicator that the droid has been moved from its current list).
@past-due past-due force-pushed the 2024_07_fix_transporter_dangling_refs_1 branch from f1b880e to afce98e Compare July 2, 2024 18:06
@past-due past-due merged commit 7ada2cc into Warzone2100:master Jul 2, 2024
37 checks passed
@past-due past-due deleted the 2024_07_fix_transporter_dangling_refs_1 branch July 2, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants