1
0

allow use failures to propagate from the entity/block to the player

This commit is contained in:
Gargaj
2015-12-01 23:12:44 +01:00
parent e7fd308ffa
commit f9008a4860
55 changed files with 120 additions and 77 deletions

View File

@@ -33,14 +33,14 @@ void cMobSpawnerEntity::SendTo(cClientHandle & a_Client)
void cMobSpawnerEntity::UsedBy(cPlayer * a_Player)
bool cMobSpawnerEntity::UsedBy(cPlayer * a_Player)
{
if (a_Player->GetEquippedItem().m_ItemType == E_ITEM_SPAWN_EGG)
{
eMonsterType MonsterType = cItemSpawnEggHandler::ItemDamageToMonsterType(a_Player->GetEquippedItem().m_ItemDamage);
if (MonsterType == eMonsterType::mtInvalidType)
{
return;
return false;
}
m_Entity = MonsterType;
@@ -50,7 +50,9 @@ void cMobSpawnerEntity::UsedBy(cPlayer * a_Player)
a_Player->GetInventory().RemoveOneEquippedItem();
}
LOGD("Changed monster spawner at {%d, %d, %d} to type %s.", GetPosX(), GetPosY(), GetPosZ(), cMonster::MobTypeToString(MonsterType).c_str());
return true;
}
return false;
}