Skip to content

Commit c99361a

Browse files
committed
Put Actor before death callback into ifdef block
1 parent e6253a5 commit c99361a

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

src/Common/Config.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
// TWEAKS:
2020
//#define FP_DEATH // first person death view
21+
//#define ACTOR_BEFORE_DEATH_CALLBACK
2122
#define DEAD_BODY_COLLISION // restore collision with dead bodies (thanks malandrinus)
2223
#define NEW_ANIMS // use new animations. Please enclose any new animation addions with this define
2324
#define NEW_SOUNDS // use new sounds. Please enclose any new sound addions with this define

src/xrGame/Entity.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,13 @@ void CEntity::KillEntity(u16 whoID, bool bypass_actor_check)
257257
//AVO: allow scripts to process actor condition and prevent actor's death or kill him if desired.
258258
//IMPORTANT: if you wish to kill actor you need to call db.actor:kill(level:object_by_id(whoID), true) in actor_before_death callback, to ensure all objects are properly destroyed
259259
// this will bypass below if block and go to normal KillEntity routine.
260+
#ifdef ACTOR_BEFORE_DEATH_CALLBACK
260261
if (IsGameTypeSingle() && this->ID() == Actor()->ID() && bypass_actor_check != true)
261262
{
262263
Actor()->callback(GameObject::eActorBeforeDeath)(whoID);
263264
return;
264265
}
266+
#endif
265267
//-AVO
266268

267269
if (this->ID() == Actor()->ID())

src/xrGame/game_object_space.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ enum ECallbackType
6666
eItemToSlot,
6767
eItemToRuck,
6868
// Actor
69+
#ifdef ACTOR_BEFORE_DEATH_CALLBACK
6970
eActorBeforeDeath,
71+
#endif
7072
//-AVO
7173

7274
eDummy = u32(-1),

src/xrGame/script_game_object_script.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ SCRIPT_EXPORT(CScriptGameObject, (), {
9595
value("item_to_slot", int(GameObject::eItemToSlot)),
9696
value("item_to_ruck", int(GameObject::eItemToRuck)),
9797
// Actor
98+
#ifdef ACTOR_BEFORE_DEATH_CALLBACK
9899
value("actor_before_death", int(GameObject::eActorBeforeDeath)),
100+
#endif
99101
//-AVO
100102

101103
value("map_location_added", int(GameObject::eMapLocationAdded))],

0 commit comments

Comments
 (0)