1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 12:23:53 +00:00

Removed some duplicated operations.

This commit is contained in:
dteviot 2015-07-26 11:15:21 +12:00
parent fcf9ae42f4
commit aba7225817

View file

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