daid / daid/EmptyEpsilon

[Regression] SP global destroyScript() no longer exists but is still invoked

Open
#2,594 0 comments 0 reactions 0 assignees View on GitHub

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.

  1. Launch any scenario with station entities, such as scenario_00_basic.lua.
  2. Open comms with a station and order a supply drop.
  3. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.