mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-12-12 19:23:08 +00:00
This commit is contained in:
parent
df7213185f
commit
c4e5872620
1 changed files with 5 additions and 2 deletions
|
|
@ -377,8 +377,11 @@ namespace MWMechanics
|
||||||
bool canMoveByZ = (actorClass.canSwim(actor) && world->isSwimming(actor))
|
bool canMoveByZ = (actorClass.canSwim(actor) && world->isSwimming(actor))
|
||||||
|| world->isFlying(actor);
|
|| world->isFlying(actor);
|
||||||
|
|
||||||
|
// for distant combat we should know if target is in LOS even if distToTarget < rangeAttack
|
||||||
|
bool inLOS = distantCombat ? world->getLOS(actor, target) : true;
|
||||||
|
|
||||||
// (within attack dist) || (not quite attack dist while following)
|
// (within attack dist) || (not quite attack dist while following)
|
||||||
if(distToTarget < rangeAttack || (distToTarget <= rangeFollow && mFollowTarget && !isStuck) )
|
if(inLOS && (distToTarget < rangeAttack || (distToTarget <= rangeFollow && mFollowTarget && !isStuck)))
|
||||||
{
|
{
|
||||||
//Melee and Close-up combat
|
//Melee and Close-up combat
|
||||||
|
|
||||||
|
|
@ -437,7 +440,7 @@ namespace MWMechanics
|
||||||
else // remote pathfinding
|
else // remote pathfinding
|
||||||
{
|
{
|
||||||
bool preferShortcut = false;
|
bool preferShortcut = false;
|
||||||
bool inLOS = world->getLOS(actor, target);
|
if (!distantCombat) inLOS = world->getLOS(actor, target);
|
||||||
|
|
||||||
// check if shortcut is available
|
// check if shortcut is available
|
||||||
if(inLOS && (!isStuck || mReadyToAttack)
|
if(inLOS && (!isStuck || mReadyToAttack)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue