Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ UpdateSleepTime StickyBombUpdate::update( void )
//-------------------------------------------------------------------------------------------------
Object* StickyBombUpdate::getTargetObject() const
{
// Validate the target ID before attempting to find the object
// This prevents crashes when the target has been destroyed but m_targetID still holds the old ID
if( m_targetID == INVALID_ID )
{
return NULL;
}

return TheGameLogic->findObjectByID( m_targetID );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ UpdateSleepTime StickyBombUpdate::update( void )
//-------------------------------------------------------------------------------------------------
Object* StickyBombUpdate::getTargetObject() const
{
// Validate the target ID before attempting to find the object
// This prevents crashes when the target has been destroyed but m_targetID still holds the old ID
if( m_targetID == INVALID_ID )
{
return NULL;
}

return TheGameLogic->findObjectByID( m_targetID );
}

Expand Down
Loading