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

Events: Fixed DETECT_ENTER firing when should be DETECT_EXIT #1774

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ https://github.com/nwnxee/unified/compare/build8193.36.12...HEAD
### Fixed
- Race: Documentation updated as `NWNX_Utils` is no longer required with introduction of native `Get2DARowCount()`.
- Core README indicated wrong argument for logging. `NWNX_CORE_LOG_FILE_NAME` should have been `NWNX_CORE_LOG_FILE_PATH`.
- Events: Fixed `NWNX_ON_DETECT_ENTER_*` events firing when it should have been `NWNX_ON_DETECT_EXIT_*`.

## 8193.36.10
https://github.com/nwnxee/unified/compare/build8193.36.9...build8193.36.10
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Events/Events/StealthEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void SetDetectModeHook(CNWSCreature* thisPtr, uint8_t nDetectMode)
}
else if(currentlyDetecting && !willBeDetecting)
{
if (SignalEvent("NWNX_ON_DETECT_ENTER_BEFORE", thisPtr->m_idSelf))
if (SignalEvent("NWNX_ON_DETECT_EXIT_BEFORE", thisPtr->m_idSelf))
{
s_SetDetectModeHook->CallOriginal<void>(thisPtr, nDetectMode);
}
Expand All @@ -130,7 +130,7 @@ void SetDetectModeHook(CNWSCreature* thisPtr, uint8_t nDetectMode)
thisPtr->SetActivity(0, true);
}

SignalEvent("NWNX_ON_DETECT_ENTER_AFTER", thisPtr->m_idSelf);
SignalEvent("NWNX_ON_DETECT_EXIT_AFTER", thisPtr->m_idSelf);
}
}

Expand Down
Loading