mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Fix
This commit is contained in:
parent
37d630c2ba
commit
f4db2495e8
|
|
@ -15,6 +15,9 @@ LookControl::LookControl(Mob *mob)
|
||||||
|
|
||||||
void LookControl::setLookAt(shared_ptr<Entity> target, float yMax, float xMax)
|
void LookControl::setLookAt(shared_ptr<Entity> target, float yMax, float xMax)
|
||||||
{
|
{
|
||||||
|
if (target == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
wantedX = target->x;
|
wantedX = target->x;
|
||||||
if ( target->instanceof(eTYPE_LIVINGENTITY) ) wantedY = target->y + dynamic_pointer_cast<LivingEntity>(target)->getHeadHeight();
|
if ( target->instanceof(eTYPE_LIVINGENTITY) ) wantedY = target->y + dynamic_pointer_cast<LivingEntity>(target)->getHeadHeight();
|
||||||
else wantedY = (target->bb->y0 + target->bb->y1) / 2;
|
else wantedY = (target->bb->y0 + target->bb->y1) / 2;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue