Item-dropping code rewritten and centralized - now there's only one place to modify if we want to split or merge same-item drops: cWorld:SpawnItemPickups(). Also, mined blocks can now drop more items, and they recognize if they're being mined by the correct tool.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@561 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user