mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 07:53:53 +00:00
Removed some duplicated operations.
This commit is contained in:
parent
fcf9ae42f4
commit
aba7225817
1 changed files with 4 additions and 5 deletions
|
@ -181,13 +181,15 @@ namespace MWMechanics
|
|||
// get or create temporary storage
|
||||
AiCombatStorage& storage = state.get<AiCombatStorage>();
|
||||
|
||||
const MWWorld::Class& actorClass = actor.getClass();
|
||||
|
||||
|
||||
//General description
|
||||
if(actor.getClass().getCreatureStats(actor).isDead())
|
||||
if (actorClass.getCreatureStats(actor).isDead())
|
||||
return true;
|
||||
|
||||
MWWorld::Ptr target = MWBase::Environment::get().getWorld()->searchPtrViaActorId(mTargetActorId);
|
||||
MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||
MWWorld::Ptr target = world->searchPtrViaActorId(mTargetActorId);
|
||||
if (target.isEmpty())
|
||||
return false;
|
||||
|
||||
|
@ -196,9 +198,6 @@ namespace MWMechanics
|
|||
|| target.getClass().getCreatureStats(target).isDead())
|
||||
return true;
|
||||
|
||||
const MWWorld::Class& actorClass = actor.getClass();
|
||||
MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||
|
||||
|
||||
//Update every frame
|
||||
bool& combatMove = storage.mCombatMove;
|
||||
|
|
Loading…
Reference in a new issue