Skip to content

Commit

Permalink
Merge pull request #1774 from plenarius/fix-exit-detect-event
Browse files Browse the repository at this point in the history
Events: Fixed DETECT_ENTER firing when should be DETECT_EXIT
  • Loading branch information
plenarius authored Sep 13, 2024
2 parents 0880a3b + 2ee0c1b commit e560c10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit e560c10

Please sign in to comment.