Entities now bail out of ticks if destroyed (#3363)
This commit is contained in:
@@ -231,6 +231,11 @@ void cMonster::StopMovingToPosition()
|
||||
void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
return;
|
||||
}
|
||||
GET_AND_VERIFY_CURRENT_CHUNK(Chunk, POSX_TOINT, POSZ_TOINT);
|
||||
|
||||
ASSERT((GetTarget() == nullptr) || (GetTarget()->IsPawn() && (GetTarget()->GetWorld() == GetWorld())));
|
||||
|
||||
Reference in New Issue
Block a user