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
This commit is contained in:
@@ -23,18 +23,9 @@ cFlowerPotEntity::cFlowerPotEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta
|
||||
|
||||
|
||||
|
||||
void cFlowerPotEntity::Destroy(void)
|
||||
cItems cFlowerPotEntity::ConvertToPickups() const
|
||||
{
|
||||
// Drop the contents as pickups:
|
||||
if (!m_Item.IsEmpty())
|
||||
{
|
||||
ASSERT(m_World != nullptr);
|
||||
cItems Pickups;
|
||||
Pickups.Add(m_Item);
|
||||
m_World->SpawnItemPickups(Pickups, Vector3d(0.5, 0.5, 0.5) + m_Pos);
|
||||
|
||||
m_Item.Empty();
|
||||
}
|
||||
return cItem(m_Item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user