Skip to content

Match Lua Mine() radar blip size to launched medium mines - #2927

Closed
dj803 wants to merge 1 commit into
daid:masterfrom
dj803:fix/2883-lua-mine-size
Closed

dj803 wants to merge 1 commit into
daid:masterfrom
dj803:fix/2883-lua-mine-size

Conversation

@dj803

@dj803 dj803 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Refs #2883 (closed as filed against an older version). The numbers below are from current master, so I'm opening this in case it is still wanted; feel free to close it if not.

Cause
scripts/api/entity/mine.lua gives Mine() a radar_trace with min_size=10, max_size=10. Mines launched from a tube get 32 * (0.25 + 0.25 * category_modifier) in src/systems/missilesystem.cpp. For the medium category category_modifier is 1.0 (MissileWeaponData::convertSizeToCategoryModifier), so 16. Player-launched medium mines therefore have a larger blip than scripted ones.

Change
One line: min_size/max_size 10 -> 16 in mine.lua. The change was suggested by oznogon in the issue body (credited in the commit message).

Checks run

  • Lua 5.4 syntax parse of scripts/**.lua (the engine's own Lua): 0 failed.

  • Grep: no other place in scripts/, src/ or docs hard-codes 10 for the mine trace (scanprobe.lua and probe.cpp use 10 for probes, unrelated).

  • Built the branch (MSVC RelWithDebInfo; rebuilt after rebasing onto current master 2026-11-13). Headless scenario: Atlantis, 5 medium tubes, fired mines, then read radar_trace of every mine entity. Before the change: Mine() min/max 10, launched medium 16. After: both 16.

Not tested

  • Headless value check only; no visual look at the radar screen.
  • Not tested with other tube sizes: small (0.5 -> 12) and large (2.0 -> 40) launched mines still differ from the scripted mine, by design.
  • Scenarios using Mine() (e.g. scenario_00_basic.lua) were not run.

Possible conflict
Open PR #2737 (oznogon, "Create, tweak missiles using scripts or GM screen") also touches mine.lua; it refactors it without changing the size, so a trivial merge conflict on that line is possible.

🤖 Generated with Claude Code

Mine() gave its radar_trace min/max size 10, while mines launched from a
tube use 32*(0.25+0.25*category_modifier) in missilesystem.cpp, which is 16
for the medium category (modifier 1.0). Use 16 so scripted and player-launched
medium mines look the same on radar.

Fixes daid#2883

Suggested-by: oznogon (patch in the issue body)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dj803 dj803 closed this Nov 13, 2026
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.

1 participant