Skip to content

Commit

Permalink
Fix crash when +USEing NPCs that have just exited a scripted sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVanheer committed Oct 14, 2023
1 parent 2011d16 commit 84363e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* Fixed torch and medic grunts, male assassins and shock troopers continuing to fire for a few seconds after killing the last enemy in an area [#100](https://github.com/SamVanheer/halflife-op4-updated/issues/100) (Thanks Ronin4862 and malortie)
* Fixed Gonome crashing the game if the player dies while being damaged by Gonome's chest mouth (Thanks malortie)
* Save and restore allied grunt repel entities to ensure spawned NPCs have correct properties (Thanks malortie)
* Fixed crash when +USEing NPCs that have just exited a scripted sequence (Thanks malortie)

## Changes in V1.0.0 Release Candidate 001

Expand Down
5 changes: 4 additions & 1 deletion dlls/COFAllyMonster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,10 @@ bool COFAllyMonster::CanFollow()
{
if (m_MonsterState == MONSTERSTATE_SCRIPT)
{
if (!m_pCine->CanInterrupt())
// It's possible for m_MonsterState to still be MONSTERSTATE_SCRIPT when the script has already ended.
// We'll treat a null pointer as an uninterruptable script and wait for the NPC to change states
// before allowing players to make them follow them again.
if (!m_pCine || !m_pCine->CanInterrupt())
return false;
}

Expand Down

0 comments on commit 84363e2

Please sign in to comment.