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
  • Loading branch information
dscharrer committed Jan 14, 2022
1 parent 1a99607 commit f24f6f6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -23,6 +23,7 @@ Controls:

Audio:

* Fixed missing death screams for most NPCs (bug #1579)
* Fixed some audio samples not ending correctly
* Fixed lighting strike damage sound being played for every frame

Expand Down
2 changes: 0 additions & 2 deletions src/game/Damage.cpp
Expand Up @@ -626,8 +626,6 @@ void ARX_DAMAGES_ForceDeath(Entity & io_dead, Entity * io_killer) {
resetNpcBehavior(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 @@ -63,6 +63,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 @@ -276,6 +277,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 @@ -193,8 +193,6 @@ void ARX_INTERACTIVE_DestroyDynamicInfo(Entity * io) {
}
}

ARX_SPEECH_ReleaseIOSpeech(io);

ARX_SCRIPT_EventStackClearForIo(io);

spells.endByCaster(io->index());
Expand Down

0 comments on commit f24f6f6

Please sign in to comment.