From c640e9346c5e6c72b62b1beeaf5ec6de9cdc6924 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 25 May 2013 11:59:13 +0000 Subject: cChestEntity and cDispenserEntity now inherit from a common ancestor, cBlockEntityWithItems git-svn-id: http://mc-server.googlecode.com/svn/trunk@1507 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ChestEntity.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'source/ChestEntity.cpp') diff --git a/source/ChestEntity.cpp b/source/ChestEntity.cpp index e0f818de0..45c543538 100644 --- a/source/ChestEntity.cpp +++ b/source/ChestEntity.cpp @@ -24,8 +24,7 @@ class cRoot; cChestEntity::cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ) : - super(E_BLOCK_CHEST, a_BlockX, a_BlockY, a_BlockZ), - m_Contents(c_ChestWidth, c_ChestHeight) + super(E_BLOCK_CHEST, a_BlockX, a_BlockY, a_BlockZ, ContentsWidth, ContentsHeight, NULL) { cBlockEntityWindowOwner::SetBlockEntity(this); } @@ -35,8 +34,7 @@ cChestEntity::cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ) : cChestEntity::cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World) : - super(E_BLOCK_CHEST, a_BlockX, a_BlockY, a_BlockZ, a_World), - m_Contents(c_ChestWidth, c_ChestHeight) + super(E_BLOCK_CHEST, a_BlockX, a_BlockY, a_BlockZ, ContentsWidth, ContentsHeight, a_World) { cBlockEntityWindowOwner::SetBlockEntity(this); } @@ -58,19 +56,6 @@ cChestEntity::~cChestEntity() -void cChestEntity::Destroy(void) -{ - // Drop items - cItems Pickups; - m_Contents.CopyToItems(Pickups); - m_Contents.Clear(); - m_World->SpawnItemPickups(Pickups, m_PosX, m_PosY, m_PosZ); -} - - - - - bool cChestEntity::LoadFromJson(const Json::Value & a_Value) { m_PosX = a_Value.get("x", 0).asInt(); -- cgit v1.2.3