Zero-K
Zero-K copied to clipboard
Six small bugs with one- or two-line fixes: team changes, jumps on Repeat, Artefact Control
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
- 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:1890readsfromConIDToCarryingTransportID[unitID]where it meansfromTransportIDToCarriedConID[unitID], so line 1891 errors with "table index is nil". Tested: removed on master, kept with the one-word fix. - 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: aUnitTakenthat callsremoveUnit(unitID, unitDefID, oldTeam). - Transport AI keeps the old team after a commshare merge:
PlayerChanged(unit_transport_ai.lua:332) sets a globalteamIDinstead ofmyTeamID, so Embark and auto-call ignore the merged units. Fix:myTeamID = Spring.GetMyTeamID(). - 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 theShrinkRadiuspath, soselfMoveSpeedChangestays at the cloak's move mult. Fix: callUpdateMoveSpeedMult(unitID, def, false)there.
Other
- Jumpers on Repeat jump to the same spot only once:
AttemptJump(unit_jumpjets.lua:601-604) keepslastJumpPositionafter using it to remove the finished jump, so every later jump to that spot is removed without jumping. Fix: clear it beforereturn true, true. Tested (Pyro, Move then Jump, Repeat on): 1 jump in 36 s on master, 3 with the fix. - 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 trueat 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.
One issue one ticket.
If you have fixes make PRs.