[Regression] SP global destroyScript() no longer exists but is still invoked
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 869
- Forks
- 222
- Avg merge
- 18h 33m
- Merged PRs (30d)
- 1
Description
Issue
SP provided a destroyScripts() global in the legacy branch, but no longer does in the master branch. The scripts supply_drop.lua and border_defend_station.lua still invoke it in their update loops when the entity they're associated with no longer exists, and its absence causes the scripts to emit an attempt to call a nil value error every update.
Steps to reproduce
Requires applying the workaround in #2593 first.
- Launch any scenario with station entities, such as scenario_00_basic.lua.
- Open comms with a station and order a supply drop.
- Destroy the supply drop ship.
Expected behavior
The supply drop ship is destroyed without error. The supply_drop.lua script no longer runs.
Observed behavior
The supply drop ship is destroyed, but the supply_drop.lua script continues running. Every tick emits an error:
supply_drop.lua:15: attempt to call a nil value (global `destroyScript`)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect supply_drop.lua and border_defend_station.lua, especially their update loops, and compare the current lifecycle behavior with the legacy destroyScripts() handling. Reproduce with the workaround from #2593 in scenario_00_basic.lua by destroying the supply drop ship. Done means the associated script stops running without emitting a nil-value error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100