mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-13 09:42:29 +00:00
Merge 383df5c8ed into 09df8928ee
This commit is contained in:
commit
290a6f2f24
|
|
@ -33,7 +33,11 @@ bool MultiEntityMobPart::isPickable()
|
||||||
|
|
||||||
bool MultiEntityMobPart::hurt(DamageSource *source, float damage)
|
bool MultiEntityMobPart::hurt(DamageSource *source, float damage)
|
||||||
{
|
{
|
||||||
return parentMob.lock()->hurt( dynamic_pointer_cast<MultiEntityMobPart>( shared_from_this() ), source, damage);
|
if (auto parent = parentMob.lock()) {
|
||||||
|
return parent->hurt(dynamic_pointer_cast<MultiEntityMobPart>(shared_from_this()), source, damage);
|
||||||
|
}
|
||||||
|
// If the parent doesn't exist, safely ignore the damage to avoid the Crashing
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MultiEntityMobPart::is(shared_ptr<Entity> other)
|
bool MultiEntityMobPart::is(shared_ptr<Entity> other)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue