From 90be4e7efdb455dc4bf4e150c403586a5c73d3f1 Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Sat, 3 Sep 2016 14:31:27 +0300 Subject: Entities now bail out of ticks if destroyed (#3363) --- src/Entities/Pawn.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Entities/Pawn.cpp') diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp index 04425dd51..dbcaba591 100644 --- a/src/Entities/Pawn.cpp +++ b/src/Entities/Pawn.cpp @@ -111,7 +111,11 @@ void cPawn::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) m_World->ForEachEntityInBox(cBoundingBox(GetPosition(), GetWidth(), GetHeight()), Callback); super::Tick(a_Dt, a_Chunk); - + if (!IsTicking()) + { + // The base class tick destroyed us + return; + } HandleFalling(); } -- cgit v1.2.3