Skip to content

Commit

Permalink
Damage: Don't end speech on death
Browse files Browse the repository at this point in the history
In Arx Fatalis 1.21. ARX_SPEECH_ReleaseIOSpeech did not work correctly.
This was fixed in commit aac2d8c for Arx Libertatis 1.0.3 because it
left dangling references after entity destruction.

However, ARX_SPEECH_ReleaseIOSpeech also got called on NPC death where
that fix meant that the death scream no longer gets played. Fix that.

Fixes: issue #1579
(cherry picked from commit f24f6f6)
  • Loading branch information
dscharrer committed Apr 2, 2022
1 parent 332562f commit b479d81
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/game/Damage.cpp
Expand Up @@ -550,8 +550,6 @@ void ARX_DAMAGES_ForceDeath(Entity & io_dead, Entity * io_killer) {

ARX_NPC_Behaviour_Reset(&io_dead);

ARX_SPEECH_ReleaseIOSpeech(&io_dead);

ARX_SCRIPT_Timer_Clear_For_IO(&io_dead);

if(io_dead.mainevent != SM_DEAD) {
Expand Down
3 changes: 3 additions & 0 deletions src/game/Entity.cpp
Expand Up @@ -65,6 +65,7 @@ ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.

#include "gui/Dragging.h"
#include "gui/Interface.h"
#include "gui/Speech.h"
#include "gui/hud/SecondaryInventory.h"

#include "io/log/Logger.h"
Expand Down Expand Up @@ -286,6 +287,8 @@ void Entity::cleanReferences() {
}
gameFlags &= ~GFLAG_ISINTREATZONE;

ARX_SPEECH_ReleaseIOSpeech(this);

ARX_INTERACTIVE_DestroyDynamicInfo(this);

removeFromInventories(this);
Expand Down
2 changes: 0 additions & 2 deletions src/scene/Interactive.cpp
Expand Up @@ -200,8 +200,6 @@ void ARX_INTERACTIVE_DestroyDynamicInfo(Entity * io)
}
}

ARX_SPEECH_ReleaseIOSpeech(io);

ARX_SCRIPT_EventStackClearForIo(io);

if(ValidIONum(n)) {
Expand Down

0 comments on commit b479d81

Please sign in to comment.