mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-13 12:43:51 +00:00
Fix: The game crashed after spawn WitherBoss in the End
This commit is contained in:
parent
a195ac7172
commit
4f488a31aa
2 changed files with 5 additions and 79 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