Skip to content

Commit 3c7d4ed

Browse files
committed
Fix crash when +USEing NPCs that have just exited a scripted sequence
1 parent ed5a970 commit 3c7d4ed

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Fixed save game system not saving arrays of EHANDLEs if the first half of the array contains null handles (mainly affected Nihilanth's spheres) [#224](https://github.com/SamVanheer/halflife-updated/issues/224) (Thanks Ronin4862)
2020
* Fixed player gaining health when drowning with god mode enabled and recovering health after surfacing (Thanks malortie)
2121
* Fixed human grunts continuing to fire for a few seconds after killing the last enemy in an area [Opposing Force Updated #100](https://github.com/SamVanheer/halflife-op4-updated/issues/100) (Thanks Ronin4862 and malortie)
22+
* Fixed crash when +USEing NPCs that have just exited a scripted sequence (Thanks malortie)
2223

2324
### Features
2425

dlls/talkmonster.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,10 @@ bool CTalkMonster::CanFollow()
13811381
{
13821382
if (m_MonsterState == MONSTERSTATE_SCRIPT || m_IdealMonsterState == MONSTERSTATE_SCRIPT)
13831383
{
1384-
if (!m_pCine->CanInterrupt())
1384+
// It's possible for m_MonsterState to still be MONSTERSTATE_SCRIPT when the script has already ended.
1385+
// We'll treat a null pointer as an uninterruptable script and wait for the NPC to change states
1386+
// before allowing players to make them follow them again.
1387+
if (!m_pCine || !m_pCine->CanInterrupt())
13851388
return false;
13861389
}
13871390

0 commit comments

Comments
 (0)