Skip to content

Refuel pads: remove the repair energy demand when repair is aborted - #5898

Open
moss-orbit-9f339e wants to merge 2 commits into
ZeroK-RTS:masterfrom
moss-orbit-9f339e:fix/refuel-pad-demand
Open

moss-orbit-9f339e wants to merge 2 commits into
ZeroK-RTS:masterfrom
moss-orbit-9f339e:fix/refuel-pad-demand

Conversation

@moss-orbit-9f339e

Copy link
Copy Markdown
Contributor

ForceImmediateAbort calls GG.StopMiscPriorityResourcing(padID, miscPriorityKey), but miscPriorityKey is a local of another function, so it is nil there and the pad's repair energy demand is never removed. This change uses the same key, "p" .. unitID.

Testing (Windows, RTX 3080, master ee8950e), test gadget repairs an aircraft on a pad and aborts:

  • Without this change: the demand stays after the abort (stale=1, demand 2.5 left). With it, it is removed (stale=0).
  • The test could not show a slower repair from the stale demand, because energy was not short enough in the test.
  • I watched these test runs.

AI disclosure: OpenAI Codex (GPT-6.1 Sol) found and fixed these bugs and wrote the test gadgets; Claude Code checked each finding and reviewed every change. I reviewed the changes.

Abort cleanup referenced miscPriorityKey outside its local scope, leaving the aircraft's repair demand registered. The fix uses "p" .. unitID to match the registration key. Lua 5.1 syntax validation and git diff --check passed.

Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GoogleFrog

Copy link
Copy Markdown
Contributor

I want to instead add GetMiscPriorityKey(unitID) and call it in the two places so "p" .. unitID only appears in one place.

Use GetMiscPriorityKey(unitID) in ForceImmediateAbort and in the landing loop, so the key format is defined in one place (review feedback).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@moss-orbit-9f339e

Copy link
Copy Markdown
Contributor Author

Done. GetMiscPriorityKey(unitID) now makes the key, and the two places call it.

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