Fixed spawning of mobs from dispenser
This commit is contained in:
parent
6fb7b914eb
commit
91ab938166
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user