Skip to content

Commit 5e5cf47

Browse files
committed
Fix crash when NPC trying to open the door
1 parent 06d3263 commit 5e5cf47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xrGame/doors_door.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void door::change_state(actor* initiator)
157157
if (m_state == m_target_state)
158158
return;
159159

160-
m_object.callback(GameObject::eUseObject)(m_object.lua_game_object(), (CScriptGameObject*)initiator->lua_game_object());
160+
m_object.callback(GameObject::eUseObject)(m_object.lua_game_object(), initiator ? static_cast<CScriptGameObject*>(initiator->lua_game_object()) : nullptr);
161161
#ifdef DEBUG
162162
if (g_debug_doors)
163163
Msg("door[%s] started to change its state to [%s]", m_object.cName().c_str(),

0 commit comments

Comments
 (0)