mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 06:55:54 -04:00
fix using potion as weapon
This commit is contained in:
parent
30d5c7488d
commit
48765f2ff2
@ -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…
x
Reference in New Issue
Block a user