daid / daid/EmptyEpsilon

[Regression] All entities without reactors return 1000 to Lua getEnergy() and getMaxEnergy()

Open
#2,540 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

In 2024.12.08, SpaceShips return 1000 to getEnergy() and getMaxEnergy() if they lack a reactor, but other non-STBO entities such as asteroids return an error. On master, all entities, including non-STBOs, return 1000 energy and max energy if they lack a reactor.

Steps to reproduce

  1. Place an Asteroid in a scenario.
  2. Run the scenario.
  3. Select the Asteroid in the GM screen
  4. From the Lua console, run print(getGMSelection()[1]:getEnergy()) or print(getGMSelection()[1]:getMaxEnergy())

Expected behavior

The asteroid either returns a sensible value (such as 0) or throws an error. In 2024.12.08, the asteroid throws attempt to call a nil value (method 'getEnergy') or attempt to call a nil value (method 'getMaxEnergy').

Observed behavior

The asteroid returns 1000 for both.

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

Start by reproducing the issue with an Asteroid selected in the GM screen, then run getEnergy() and getMaxEnergy() from the Lua console. Compare the results on master with 2024.12.08. Done means entities without reactors no longer incorrectly return 1000, with behavior matching the selected expected outcome: a sensible value or an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.