Fixed incompatibility to apples c++ compiler...
git-svn-id: http://mc-server.googlecode.com/svn/trunk@680 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
f473f13585
commit
aaf772f68a
@ -237,7 +237,10 @@ void cItemHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, cItem *a_Item,
|
|||||||
cBlockHandler *Handler = cBlockHandler::GetBlockHandler(Block);
|
cBlockHandler *Handler = cBlockHandler::GetBlockHandler(Block);
|
||||||
Handler->PlaceBlock(a_World, a_Player, GetBlockMeta(a_Item->m_ItemHealth), a_X, a_Y, a_Z, a_Dir);
|
Handler->PlaceBlock(a_World, a_Player, GetBlockMeta(a_Item->m_ItemHealth), a_X, a_Y, a_Z, a_Dir);
|
||||||
if(a_Player->GetGameMode() == eGameMode_Survival)
|
if(a_Player->GetGameMode() == eGameMode_Survival)
|
||||||
a_Player->GetInventory().RemoveItem(cItem(a_Item->m_ItemID, 1));
|
{
|
||||||
|
cItem Item(a_Item->m_ItemID, 1);
|
||||||
|
a_Player->GetInventory().RemoveItem(Item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cItemHandler::EatItem(cPlayer *a_Player, cItem *a_Item)
|
bool cItemHandler::EatItem(cPlayer *a_Player, cItem *a_Item)
|
||||||
|
@ -33,11 +33,13 @@ public:
|
|||||||
NewItem = E_ITEM_LAVA_BUCKET;
|
NewItem = E_ITEM_LAVA_BUCKET;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
cItem Item(a_Item->m_ItemID, 1);
|
||||||
if (NewItem != E_ITEM_EMPTY
|
if (NewItem != E_ITEM_EMPTY
|
||||||
&& (a_Player->GetGameMode() == 1 || (a_Player->GetInventory().RemoveItem(cItem(a_Item->m_ItemID, 1)))))
|
&& (a_Player->GetGameMode() == 1 || (a_Player->GetInventory().RemoveItem(Item))))
|
||||||
{
|
{
|
||||||
//Give New Bucket
|
//Give New Bucket
|
||||||
a_Player->GetInventory().AddItem(cItem(NewItem, 1));
|
cItem Item(NewItem, 1);
|
||||||
|
a_Player->GetInventory().AddItem(Item);
|
||||||
//remove water block
|
//remove water block
|
||||||
a_Player->GetWorld()->SetBlock(a_X, a_Y, a_Z, E_BLOCK_AIR, 0);
|
a_Player->GetWorld()->SetBlock(a_X, a_Y, a_Z, E_BLOCK_AIR, 0);
|
||||||
return true;
|
return true;
|
||||||
@ -52,7 +54,8 @@ public:
|
|||||||
AddDirection(a_X, a_Y, a_Z, a_Dir);
|
AddDirection(a_X, a_Y, a_Z, a_Dir);
|
||||||
if(a_World->GetBlock(a_X, a_Y, a_Z) == E_BLOCK_AIR)
|
if(a_World->GetBlock(a_X, a_Y, a_Z) == E_BLOCK_AIR)
|
||||||
{
|
{
|
||||||
if ((a_Player->GetGameMode() == 1) || (a_Player->GetInventory().RemoveItem(cItem(a_Item->m_ItemID, 1))))
|
cItem Item(a_Item->m_ItemID, 1);
|
||||||
|
if ((a_Player->GetGameMode() == 1) || (a_Player->GetInventory().RemoveItem(Item)))
|
||||||
{
|
{
|
||||||
a_World->SetBlock(a_X, a_Y, a_Z, NewBlock, 0);
|
a_World->SetBlock(a_X, a_Y, a_Z, NewBlock, 0);
|
||||||
|
|
||||||
@ -60,8 +63,8 @@ public:
|
|||||||
{
|
{
|
||||||
break; //No new Bucket for creative players
|
break; //No new Bucket for creative players
|
||||||
}
|
}
|
||||||
|
cItem Item(E_ITEM_BUCKET, 1);
|
||||||
a_Player->GetInventory().AddItem(cItem(E_ITEM_BUCKET, 1));
|
a_Player->GetInventory().AddItem(Item);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,8 @@ public:
|
|||||||
{
|
{
|
||||||
if (a_Player->GetGameMode() == eGameMode_Survival)
|
if (a_Player->GetGameMode() == eGameMode_Survival)
|
||||||
{
|
{
|
||||||
a_Player->GetInventory().RemoveItem(cItem(a_Item->m_ItemID, 1, a_Item->m_ItemHealth));
|
cItem Item(a_Item->m_ItemID, 1, a_Item->m_ItemHealth);
|
||||||
|
a_Player->GetInventory().RemoveItem(Item);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,8 @@ public:
|
|||||||
&& (Block == a_Item->m_ItemID) //Same slab
|
&& (Block == a_Item->m_ItemID) //Same slab
|
||||||
&& ((Meta & 0x7) == (a_Item->m_ItemHealth & 0x7))) //Same Texture
|
&& ((Meta & 0x7) == (a_Item->m_ItemHealth & 0x7))) //Same Texture
|
||||||
{
|
{
|
||||||
if(a_Player->GetInventory().RemoveItem(cItem(a_Item->m_ItemID, 1)))
|
cItem Item(a_Item->m_ItemID, 1);
|
||||||
|
if(a_Player->GetInventory().RemoveItem(Item))
|
||||||
{
|
{
|
||||||
a_World->SetBlock(a_X, a_Y, a_Z, Block - 1, Meta); //Block - 1 simple hack to save one if statement
|
a_World->SetBlock(a_X, a_Y, a_Z, Block - 1, Meta); //Block - 1 simple hack to save one if statement
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user