Fix: The game crashed after spawn WitherBoss in the End

This commit is contained in:
Pb22j 2026-03-11 02:55:44 +03:00
parent a195ac7172
commit 4f488a31aa
2 changed files with 5 additions and 79 deletions

View file

@ -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)