mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ae552d4e85
1 changed files with 10 additions and 8 deletions
|
@ -167,11 +167,14 @@ namespace MWMechanics
|
|||
const MWWorld::Class& actorClass = actor.getClass();
|
||||
MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||
|
||||
if (!actorClass.isNpc() && target == world->getPlayerPtr() &&
|
||||
(actorClass.canSwim(actor) && !actor.getClass().canWalk(actor) // 1. pure water creature and Player moved out of water
|
||||
&& !world->isSwimming(target))
|
||||
|| (!actorClass.canSwim(actor) && world->isSwimming(target))) // 2. creature can't swim to Player
|
||||
if (!actorClass.isNpc() &&
|
||||
// 1. pure water creature and Player moved out of water
|
||||
((target == world->getPlayerPtr() &&
|
||||
actorClass.canSwim(actor) && !actor.getClass().canWalk(actor) && !world->isSwimming(target))
|
||||
// 2. creature can't swim to target
|
||||
|| (!actorClass.canSwim(actor) && world->isSwimming(target))))
|
||||
{
|
||||
if (target == world->getPlayerPtr())
|
||||
actorClass.getCreatureStats(actor).setHostile(false);
|
||||
actorClass.getCreatureStats(actor).setAttackingOrSpell(false);
|
||||
return true;
|
||||
|
@ -246,7 +249,7 @@ namespace MWMechanics
|
|||
|
||||
const ESM::Weapon *weapon = NULL;
|
||||
MWMechanics::WeaponType weaptype;
|
||||
float weapRange, weapSpeed = 1.0f;
|
||||
float weapRange;
|
||||
|
||||
actorClass.getCreatureStats(actor).setMovementFlag(CreatureStats::Flag_Run, true);
|
||||
|
||||
|
@ -275,7 +278,6 @@ namespace MWMechanics
|
|||
// All other WeapTypes are actually weapons, so get<ESM::Weapon> is safe.
|
||||
weapon = weaponSlot->get<ESM::Weapon>()->mBase;
|
||||
weapRange = weapon->mData.mReach;
|
||||
weapSpeed = weapon->mData.mSpeed;
|
||||
}
|
||||
weapRange *= 100.0f;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue