summaryrefslogtreecommitdiffstats
path: root/source/cChestEntity.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-06 22:18:50 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-06 22:18:50 +0200
commit1cca9b13b3d320ff767cfc552413265b2ef6e0d6 (patch)
treec1227f3f4141dbf2f85767a65cb9d2102a9d4010 /source/cChestEntity.cpp
parentBlockIDs, ItemIDs and Metas updated, courtesy of Taugeshtu (diff)
downloadcuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar.gz
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar.bz2
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar.lz
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar.xz
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar.zst
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.zip
Diffstat (limited to 'source/cChestEntity.cpp')
-rw-r--r--source/cChestEntity.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/cChestEntity.cpp b/source/cChestEntity.cpp
index 7a0de425a..c7f4e6b0d 100644
--- a/source/cChestEntity.cpp
+++ b/source/cChestEntity.cpp
@@ -54,15 +54,16 @@ cChestEntity::~cChestEntity()
void cChestEntity::Destroy()
{
// Drop items
+ cItems Pickups;
for( int i = 0; i < c_ChestHeight * c_ChestWidth; ++i )
{
if( !m_Content[i].IsEmpty() )
{
- cPickup * Pickup = new cPickup( m_PosX * 32 + 16, m_PosY * 32 + 16, m_PosZ * 32 + 16, m_Content[i], 0, 1.f, 0 );
- Pickup->Initialize(m_World);
+ Pickups.push_back(m_Content[i]);
m_Content[i].Empty();
}
}
+ m_World->SpawnItemPickups(Pickups, m_PosX, m_PosY, m_PosZ);
if (m_JoinedChest)
{
m_JoinedChest->RemoveJoinedChest(this);