Zero-K icon indicating copy to clipboard operation
Zero-K copied to clipboard

Six small bugs with one- or two-line fixes: team changes, jumps on Repeat, Artefact Control

Open moss-orbit-9f339e opened this issue 4 weeks ago • 1 comments

A code audit found these six; each fix is a line or two, collected here in one place so you can choose. Lines are on master 718212aa2. Three were tested in game (master, fix, master); the others are from reading the code.

When a unit changes team

  1. Chili Core Selector is removed for the rest of the game when you give away a transport that carries one of your constructors, or it is captured. gui_chili_core_selector.lua:1890 reads fromConIDToCarryingTransportID[unitID] where it means fromTransportIDToCarriedConID[unitID], so line 1891 errors with "table index is nil". Tested: removed on master, kept with the one-word fix.
  2. Ferry Points is removed after a route transport leaves your team: at the next route update if it is captured, or when a shared one later dies. The widget has no UnitTaken, so the transport stays on its route and #Spring.GetUnitIsTransporting(unitID) (cmd_ferry_points.lua:392-394) errors. Fix: a UnitTaken that calls removeUnit(unitID, unitDefID, oldTeam).
  3. Transport AI keeps the old team after a commshare merge: PlayerChanged (unit_transport_ai.lua:332) sets a global teamID instead of myTeamID, so Embark and auto-call ignore the merged units. Fix: myTeamID = Spring.GetMyTeamID().
  4. A Conjurer captured with its area cloak on keeps 2/3 speed: UnitTaken (unit_cloak_shield.lua:326-343) sets the radius to 0 without the ShrinkRadius path, so selfMoveSpeedChange stays at the cloak's move mult. Fix: call UpdateMoveSpeedMult(unitID, def, false) there.

Other

  1. Jumpers on Repeat jump to the same spot only once: AttemptJump (unit_jumpjets.lua:601-604) keeps lastJumpPosition after using it to remove the finished jump, so every later jump to that spot is removed without jumping. Fix: clear it before return true, true. Tested (Pyro, Move then Jump, Repeat on): 1 jump in 36 s on master, 3 with the fix.
  2. Artefact Control (experimental modoption) removes itself on maps with a control-point config, such as Ravaged_v2: PlaceArtefactsFromConfig (game_point_control.lua:116-133) never returns true, so destroyed artefacts never come back and there is no win check. Fix: return true at its end. Tested with a 3-artefact config: no respawn on master, respawn with the fix.

I have branches with these fixes and can open PRs for any you want.

AI disclosure: found by Claude Code in a code audit; checked and tested with Claude Code.

moss-orbit-9f339e avatar Nov 05 '26 20:11 moss-orbit-9f339e

One issue one ticket.

If you have fixes make PRs.

GoogleFrog avatar Nov 06 '26 00:11 GoogleFrog