mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-18 15:13:51 +00:00
Merge 383df5c8ed into 09df8928ee
This commit is contained in:
commit
290a6f2f24
1 changed files with 5 additions and 1 deletions
|
|
@ -33,7 +33,11 @@ bool MultiEntityMobPart::isPickable()
|
|||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue