Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searchlights: don't drop items used for settings #63429

Merged
merged 1 commit into from
Feb 5, 2023

Conversation

ehughsbaird
Copy link
Contributor

Summary

None

Purpose of change

Fixes #63333

Describe the solution

Searchlights store their settings on a processor board item, so their "beams" can have persistent behavior between turns. They do this using item vars, but these item vars linger after their death, causing the items not to stack.

Simple solution: Just don't drop these settings items. Also, erase these item vars on any existing items, so that they can now stack.

Describe alternatives you've considered

Removing these vars on death would be an alternate option, but placing it with where the item vars are set shows future contributors who might use this code as inspiration that this is a problem. It also avoids being a problem when (if) the searchlights are made to drop a disassembleable robot corpse in the future like other robots do.

Testing

No settings item fix:

  1. Spawn in several searchlights.
  2. Wait five minutes.
  3. Kill the searchlights.
  4. Searchlights will only drop processor boards as random draws from their death drops. These will stack with other processor boards.

Stacking fix:

  1. Acquire a savegame with non-stacking processor boards from searchlights.
  2. Load that savegame, and those processor boards will now stack.

Additional Context

This does mean that searchlights are no longer guaranteed to drop multiple processor items. I think that this is acceptable.

Searchlights store their settings on a processor board item, so their
"beams" can have persistent behavior between turns. They do this using
item vars, but these item vars linger after their death, causing the
items not to stack.
Simple solution: Just don't drop these settings items.
Also, erase these item vars on any existing items, so that they can now
stack.

This does mean that searchlights are no longer guaranteed to drop
multiple processor items. I think that this is acceptable, but it will
mean they drop fewer items as, unlike other robots, they do not drop a
disassemblable corpse, only a random item from an itemgroup.
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 5, 2023
@dseguin dseguin merged commit 83ed3f6 into CleverRaven:master Feb 5, 2023
@ehughsbaird ehughsbaird deleted the dont-drop-settings-boards branch February 5, 2023 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Processor boards dropped by Milspec Searchlights don't group with other ones or themselves
2 participants