forked from teamnwah/openmw-tes3coop
Merge pull request #125 from OpenMW/master
Add OpenMW commits up to 12 Jan
This commit is contained in:
commit
610ba1d867
2 changed files with 7 additions and 4 deletions
|
@ -37,6 +37,7 @@ namespace MWMechanics
|
||||||
MWWorld::Ptr getTarget() const;
|
MWWorld::Ptr getTarget() const;
|
||||||
virtual bool sideWithTarget() const { return true; }
|
virtual bool sideWithTarget() const { return true; }
|
||||||
virtual bool followTargetThroughDoors() const { return true; }
|
virtual bool followTargetThroughDoors() const { return true; }
|
||||||
|
virtual bool shouldCancelPreviousAi() const { return !mCommanded; }
|
||||||
|
|
||||||
virtual AiFollow *clone() const;
|
virtual AiFollow *clone() const;
|
||||||
|
|
||||||
|
|
|
@ -73,12 +73,14 @@ std::string getBestAttack (const ESM::Weapon* weapon)
|
||||||
int slash = (weapon->mData.mSlash[0] + weapon->mData.mSlash[1])/2;
|
int slash = (weapon->mData.mSlash[0] + weapon->mData.mSlash[1])/2;
|
||||||
int chop = (weapon->mData.mChop[0] + weapon->mData.mChop[1])/2;
|
int chop = (weapon->mData.mChop[0] + weapon->mData.mChop[1])/2;
|
||||||
int thrust = (weapon->mData.mThrust[0] + weapon->mData.mThrust[1])/2;
|
int thrust = (weapon->mData.mThrust[0] + weapon->mData.mThrust[1])/2;
|
||||||
if (slash >= chop && slash >= thrust)
|
if (slash == chop && slash == thrust)
|
||||||
return "slash";
|
return "slash";
|
||||||
else if (chop >= slash && chop >= thrust)
|
else if (thrust >= chop && thrust >= slash)
|
||||||
return "chop";
|
|
||||||
else
|
|
||||||
return "thrust";
|
return "thrust";
|
||||||
|
else if (slash >= chop && slash >= thrust)
|
||||||
|
return "slash";
|
||||||
|
else
|
||||||
|
return "chop";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Converts a movement Run state to its equivalent Walk state.
|
// Converts a movement Run state to its equivalent Walk state.
|
||||||
|
|
Loading…
Reference in a new issue