Fixed cItemGrid API, no more changeable GetSlot().
Also fixed possible water and lava duplication glitches in the dispenser. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1520 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -146,8 +146,14 @@ bool cDropSpenserEntity::LoadFromJson(const Json::Value & a_Value)
|
||||
int SlotIdx = 0;
|
||||
for (Json::Value::iterator itr = AllSlots.begin(); itr != AllSlots.end(); ++itr)
|
||||
{
|
||||
m_Contents.GetSlot(SlotIdx).FromJson(*itr);
|
||||
cItem Contents;
|
||||
Contents.FromJson(*itr);
|
||||
m_Contents.SetSlot(SlotIdx, Contents);
|
||||
SlotIdx++;
|
||||
if (SlotIdx >= m_Contents.GetNumSlots())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -210,3 +216,20 @@ void cDropSpenserEntity::UsedBy(cPlayer * a_Player)
|
||||
|
||||
|
||||
|
||||
|
||||
void cDropSpenserEntity::DropFromSlot(int a_SlotNum)
|
||||
{
|
||||
int DispX = m_PosX;
|
||||
int DispY = m_PosY;
|
||||
int DispZ = m_PosZ;
|
||||
NIBBLETYPE Meta = m_World->GetBlockMeta(m_PosX, m_PosY, m_PosZ);
|
||||
AddDropSpenserDir(DispX, DispY, DispZ, Meta);
|
||||
|
||||
cItems Pickups;
|
||||
Pickups.push_back(m_Contents.RemoveOneItem(a_SlotNum));
|
||||
m_World->SpawnItemPickups(Pickups, DispX, DispY, DispZ);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user