1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 07:15:34 +00:00

fix using potion as weapon

This commit is contained in:
mrcheko 2016-09-19 23:43:26 +03:00
parent 30d5c7488d
commit 48765f2ff2

View file

@ -229,7 +229,8 @@ namespace MWMechanics
osg::Vec3f vAimDir = MWBase::Environment::get().getWorld()->aimToTarget(actor, target);
float distToTarget = MWBase::Environment::get().getWorld()->getHitDistance(actor, target);
storage.mReadyToAttack = (distToTarget <= rangeAttack);
bool isPotion = (dynamic_cast<ActionPotion*>(currentAction.get()) != NULL);
storage.mReadyToAttack = (!isPotion && distToTarget <= rangeAttack);
// can't fight if attacker can't go where target is. E.g. A fish can't attack person on land.
if (distToTarget > rangeAttack