forked from mirror/openmw-tes3mp
fix using potion as weapon
This commit is contained in:
parent
30d5c7488d
commit
48765f2ff2
1 changed files with 2 additions and 1 deletions
|
@ -229,7 +229,8 @@ namespace MWMechanics
|
||||||
osg::Vec3f vAimDir = MWBase::Environment::get().getWorld()->aimToTarget(actor, target);
|
osg::Vec3f vAimDir = MWBase::Environment::get().getWorld()->aimToTarget(actor, target);
|
||||||
float distToTarget = MWBase::Environment::get().getWorld()->getHitDistance(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.
|
// can't fight if attacker can't go where target is. E.g. A fish can't attack person on land.
|
||||||
if (distToTarget > rangeAttack
|
if (distToTarget > rangeAttack
|
||||||
|
|
Loading…
Reference in a new issue