From 91ab93816631f42ec75a7e748fe5b4eecd0017fc Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Sat, 25 Apr 2020 09:33:33 +0200 Subject: [PATCH] Fixed spawning of mobs from dispenser --- src/BlockEntities/DispenserEntity.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BlockEntities/DispenserEntity.cpp b/src/BlockEntities/DispenserEntity.cpp index 90732931f..568609998 100644 --- a/src/BlockEntities/DispenserEntity.cpp +++ b/src/BlockEntities/DispenserEntity.cpp @@ -9,7 +9,7 @@ #include "../Entities/Boat.h" #include "../Entities/ProjectileEntity.h" #include "../Simulator/FluidSimulator.h" - +#include "../Items/ItemSpawnEgg.h" @@ -114,7 +114,8 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum) { double MobX = 0.5 + dispAbsCoord.x; double MobZ = 0.5 + dispAbsCoord.z; - if (m_World->SpawnMob(MobX, dispAbsCoord.y, MobZ, static_cast(m_Contents.GetSlot(a_SlotNum).m_ItemDamage), false) != cEntity::INVALID_ID) + auto MonsterType = cItemSpawnEggHandler::ItemDamageToMonsterType(m_Contents.GetSlot(a_SlotNum).m_ItemDamage); + if (m_World->SpawnMob(MobX, dispAbsCoord.y, MobZ, static_cast(MonsterType), false) != cEntity::INVALID_ID) { m_Contents.ChangeSlotCount(a_SlotNum, -1); }