Skip to content

Skip a tag without a trigger when a variable resets timers - #147

Open
gibbo101 wants to merge 1 commit into
OpenTS-Developers:mainfrom
gibbo101:tag-timer-reset-without-trigger
Open

Skip a tag without a trigger when a variable resets timers#147
gibbo101 wants to merge 1 commit into
OpenTS-Developers:mainfrom
gibbo101:tag-timer-reset-without-trigger

Conversation

@gibbo101

@gibbo101 gibbo101 commented Sep 8, 2026

Copy link
Copy Markdown

A tag whose trigger has been destroyed keeps a null Trigger when the destroyed trigger had no LinkedTo to take its place (Detach sets Trigger = Trigger->LinkedTo). A trigger action that sets a local or global variable then calls Timer_Local_Reset / Timer_Global_Reset on every tag, and the dereference through that null pointer crashes the game. This skips a tag without a trigger so the action completes and the other tags' timers restart as before.

Behavior: fixed. No compatibility boundary changes: no data format, save, or network representation changes; the reset runs identically on every peer.

Validation: hit in play on my controller fork, where this change has been running since. Built with the fork's experimental clang-cl cross build and CTest passes 18/18 there. I have not run the supported MSVC Win32 build; CI will cover it.

Documentation: manual/changes/tag-timer-reset-without-trigger.md (fix, targets the trigger springing system). manage.py check --base-ref main passes.

Comment thread code/tag.cpp Outdated
{
Trigger->Reset_Global_Linked_Timed_Events(global);
// A tag outlives a destroyed trigger with no link to take its place.
if (Trigger != NULL) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nullptr

Comment thread code/tag.cpp Outdated
void TagClass::Timer_Local_Reset(int local)
{
Trigger->Reset_Local_Linked_Timed_Events(local);
if (Trigger != NULL) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nullptr

@gibbo101

gibbo101 commented Sep 8, 2026

Copy link
Copy Markdown
Author

Changed both checks to nullptr.

@gibbo101
gibbo101 force-pushed the tag-timer-reset-without-trigger branch from 0934236 to 12f535a Compare September 8, 2026 20:15
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.

2 participants