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/Monster.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/Mobs/Monster.h') diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index aeb8a3bf9..eb8905ae3 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -48,14 +48,10 @@ public: */ cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, const AString & a_SoundAmbient, double a_Width, double a_Height); - virtual ~cMonster() override; + CLASS_PROTODEF(cMonster) virtual void OnRemoveFromWorld(cWorld & a_World) override; - virtual void Destroyed() override; - - CLASS_PROTODEF(cMonster) - virtual void SpawnOn(cClientHandle & a_ClientHandle) override; virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; -- cgit v1.2.3