From 16aeb84cd35996a6b41f10cbc48a677eeccc911c Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 2 Jan 2021 13:50:34 +0000 Subject: Fix potential destruction crashes (#5095) * Fix potential destruction crashes * Fix destructors accessing destroyted objects * Fix cPlayer not destroying windows (Destroyed never called) * Tentatively fixes #4608, fixes #3236, fixes #3262 - Remove cEntity::Destroyed() and replace with cEntity::OnRemoveFromWorld() * Add missing call to OnRemoveFromWorld --- src/Mobs/Horse.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/Mobs/Horse.h') diff --git a/src/Mobs/Horse.h b/src/Mobs/Horse.h index f9c236ffc..4f35071c0 100644 --- a/src/Mobs/Horse.h +++ b/src/Mobs/Horse.h @@ -17,7 +17,6 @@ class cHorse: public: cHorse(int Type, int Color, int Style, int TameTimes); - virtual ~cHorse() override; CLASS_PROTODEF(cHorse) @@ -25,6 +24,7 @@ public: virtual void InStateIdle(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; virtual void HandleSpeedFromAttachee(float a_Forward, float a_Sideways) override; virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; + virtual void OnRemoveFromWorld(cWorld & a_World) override; virtual void OnRightClicked(cPlayer & a_Player) override; bool IsSaddled (void) const {return !m_Saddle.IsEmpty(); } @@ -66,7 +66,3 @@ private: cItem m_Armor; } ; - - - - -- cgit v1.2.3