mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 10:21:11 +00:00
Don't call getClass on an empty Ptr
This commit is contained in:
parent
7a0635aeee
commit
1cf0befd07
@ -628,7 +628,8 @@ namespace MWMechanics
|
||||
}
|
||||
|
||||
std::set<MWWorld::Ptr> playerAllies;
|
||||
getActorsSidingWith(MWMechanics::getPlayer(), playerAllies, cachedAllies);
|
||||
MWWorld::Ptr player = MWMechanics::getPlayer();
|
||||
getActorsSidingWith(player, playerAllies, cachedAllies);
|
||||
|
||||
bool isPlayerFollowerOrEscorter = playerAllies.find(actor1) != playerAllies.end();
|
||||
|
||||
@ -651,7 +652,8 @@ namespace MWMechanics
|
||||
mechanicsManager->startCombat(actor1, actor2);
|
||||
// Also have actor1's allies start combat
|
||||
for (const MWWorld::Ptr& ally1 : allies1)
|
||||
mechanicsManager->startCombat(ally1, actor2);
|
||||
if (ally1 != player)
|
||||
mechanicsManager->startCombat(ally1, actor2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -756,6 +758,8 @@ namespace MWMechanics
|
||||
|
||||
MWWorld::Ptr caster
|
||||
= MWBase::Environment::get().getWorld()->searchPtrViaActorId(spell.getCasterActorId());
|
||||
if (caster.isEmpty())
|
||||
continue;
|
||||
for (const auto& effect : spell.getEffects())
|
||||
{
|
||||
static const std::array<int, 7> damageEffects{
|
||||
|
Loading…
x
Reference in New Issue
Block a user