1
0

Fixed spawning of mobs from dispenser

This commit is contained in:
Lukas Pioch 2020-04-25 09:33:33 +02:00 committed by Tiger Wang
parent 6fb7b914eb
commit 91ab938166

View File

@ -9,7 +9,7 @@
#include "../Entities/Boat.h" #include "../Entities/Boat.h"
#include "../Entities/ProjectileEntity.h" #include "../Entities/ProjectileEntity.h"
#include "../Simulator/FluidSimulator.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 MobX = 0.5 + dispAbsCoord.x;
double MobZ = 0.5 + dispAbsCoord.z; double MobZ = 0.5 + dispAbsCoord.z;
if (m_World->SpawnMob(MobX, dispAbsCoord.y, MobZ, static_cast<eMonsterType>(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<eMonsterType>(MonsterType), false) != cEntity::INVALID_ID)
{ {
m_Contents.ChangeSlotCount(a_SlotNum, -1); m_Contents.ChangeSlotCount(a_SlotNum, -1);
} }