diff options
author | luksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-11-24 10:50:38 +0100 |
---|---|---|
committer | luksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-11-24 10:50:38 +0100 |
commit | eed6f9bb7bd2553a509a7bba7be32436aa96659b (patch) | |
tree | 65894528e1dc06d872a6bd916538b221874111c3 /source/Items/ItemSpawnEgg.h | |
parent | ByteBuffer: Fixed buffer overrun possibility. (diff) | |
download | cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar.gz cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar.bz2 cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar.lz cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar.xz cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar.zst cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.zip |
Diffstat (limited to 'source/Items/ItemSpawnEgg.h')
-rw-r--r-- | source/Items/ItemSpawnEgg.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/Items/ItemSpawnEgg.h b/source/Items/ItemSpawnEgg.h index f3018075b..33a1e1d55 100644 --- a/source/Items/ItemSpawnEgg.h +++ b/source/Items/ItemSpawnEgg.h @@ -35,8 +35,11 @@ public: if (a_World->SpawnMob(a_BlockX + 0.5, a_BlockY, a_BlockZ + 0.5, a_Item->m_ItemDamage) >= 0)
{
- // The mob was spawned, "use" the item:
- a_Player->UseEquippedItem();
+ if(a_Player->GetGameMode() != 1)
+ {
+ // The mob was spawned, "use" the item:
+ a_Player->GetInventory().RemoveItem(a_Player->GetInventory().GetEquippedItem());
+ }
return true;
}
|