Skip to content

Commit 60f3ac0

Browse files
committed
Fix crash on surge end..
1 parent 17443f6 commit 60f3ac0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/xrGame/script_game_object.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ class CScriptGameObject
190190
_DECLARE_FUNCTION10(Squad, int);
191191
_DECLARE_FUNCTION10(Group, int);
192192

193-
void Kill(CScriptGameObject* who, bool bypass_actor_check = false /*AVO: added for actor before death callback*/);
193+
// XXX: this is a workaround, since luabind can't determine default function arguments...
194+
// There is more places, not only this one
195+
// Look here: https://github.com/qweasdd136963/OXR_CoC/commit/c37d8f4e49c92fe226a5958954cc9a6a1ab18c93
196+
void Kill(CScriptGameObject* who) { Kill(who, false); }
197+
void Kill(CScriptGameObject* who, bool bypass_actor_check /*= false*/ /*AVO: added for actor before death callback*/);
194198

195199
// CEntityAlive
196200
_DECLARE_FUNCTION10(GetFOV, float);

src/xrGame/script_game_object_script2.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ class_<CScriptGameObject>& script_register_game_object1(class_<CScriptGameObject
9393
.def("group", &CScriptGameObject::Group)
9494
.def("change_team", (void (CScriptGameObject::*)(u8, u8, u8))(&CScriptGameObject::ChangeTeam))
9595
.def("set_visual_memory_enabled", &CScriptGameObject::SetVisualMemoryEnabled)
96-
.def("kill", &CScriptGameObject::Kill)
97-
.def("kill", (void (CScriptGameObject::*)(CScriptGameObject*))(&CScriptGameObject::Kill))
96+
// XXX: this is a workaround, since luabind can't determine default function arguments...
97+
.def("kill", (void (CScriptGameObject::*)(CScriptGameObject*))&CScriptGameObject::Kill)
98+
.def("kill", (void (CScriptGameObject::*)(CScriptGameObject*, bool))(&CScriptGameObject::Kill))
9899
.def("hit", &CScriptGameObject::Hit)
99100
.def("play_cycle", (void (CScriptGameObject::*)(LPCSTR))(&CScriptGameObject::play_cycle))
100101
.def("play_cycle", (void (CScriptGameObject::*)(LPCSTR, bool))(&CScriptGameObject::play_cycle))

0 commit comments

Comments
 (0)