mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-10-02 17:43:41 -04:00
Windows debug build crash fix.
This commit is contained in:
parent
3dfd239b83
commit
cf23721f1b
@ -497,12 +497,12 @@ namespace MWMechanics
|
|||||||
// coded at 250ms or 1/4 second
|
// coded at 250ms or 1/4 second
|
||||||
//
|
//
|
||||||
// TODO: Add a parameter to vary DURATION_SAME_SPOT?
|
// TODO: Add a parameter to vary DURATION_SAME_SPOT?
|
||||||
|
MWWorld::CellStore *cell = actor.getCell();
|
||||||
if((distToTarget > rangeAttack || mFollowTarget) &&
|
if((distToTarget > rangeAttack || mFollowTarget) &&
|
||||||
mObstacleCheck.check(actor, tReaction)) // check if evasive action needed
|
mObstacleCheck.check(actor, tReaction)) // check if evasive action needed
|
||||||
{
|
{
|
||||||
// first check if we're walking into a door
|
// first check if we're walking into a door
|
||||||
mDoorCheckDuration += 1.0f; // add time taken for obstacle check
|
mDoorCheckDuration += 1.0f; // add time taken for obstacle check
|
||||||
MWWorld::CellStore *cell = actor.getCell();
|
|
||||||
if(mDoorCheckDuration >= DOOR_CHECK_INTERVAL && !cell->getCell()->isExterior())
|
if(mDoorCheckDuration >= DOOR_CHECK_INTERVAL && !cell->getCell()->isExterior())
|
||||||
{
|
{
|
||||||
mDoorCheckDuration = 0;
|
mDoorCheckDuration = 0;
|
||||||
@ -542,28 +542,26 @@ namespace MWMechanics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::LiveCellRef<ESM::Door>& ref = *mDoorIter;
|
if(!cell->getCell()->isExterior() && !mDoors.mList.empty())
|
||||||
float minSqr = 1.6 * 1.6 * MIN_DIST_TO_DOOR_SQUARED; // for legibility
|
|
||||||
// TODO: add reaction to checking open doors
|
|
||||||
if(mBackOffDoor &&
|
|
||||||
vActorPos.squaredDistance(Ogre::Vector3(ref.mRef.mPos.pos)) < minSqr)
|
|
||||||
{
|
{
|
||||||
mMovement.mPosition[1] = -0.2; // back off, but slowly
|
MWWorld::LiveCellRef<ESM::Door>& ref = *mDoorIter;
|
||||||
|
float minSqr = 1.6 * 1.6 * MIN_DIST_TO_DOOR_SQUARED; // for legibility
|
||||||
|
// TODO: add reaction to checking open doors
|
||||||
|
if(mBackOffDoor &&
|
||||||
|
vActorPos.squaredDistance(Ogre::Vector3(ref.mRef.mPos.pos)) < minSqr)
|
||||||
|
{
|
||||||
|
mMovement.mPosition[1] = -0.2; // back off, but slowly
|
||||||
|
}
|
||||||
|
else if(mBackOffDoor &&
|
||||||
|
mDoorIter != mDoors.mList.end() &&
|
||||||
|
ref.mData.getLocalRotation().rot[2] >= 1)
|
||||||
|
{
|
||||||
|
mDoorIter = mDoors.mList.end();
|
||||||
|
mBackOffDoor = false;
|
||||||
|
//std::cout<<"open door id \""<<ref.mRef.mRefID<<"\""<<std::endl;
|
||||||
|
mMovement.mPosition[1] = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(mBackOffDoor &&
|
|
||||||
mDoorIter != mDoors.mList.end() &&
|
|
||||||
ref.mData.getLocalRotation().rot[2] >= 1)
|
|
||||||
{
|
|
||||||
mDoorIter = mDoors.mList.end();
|
|
||||||
mBackOffDoor = false;
|
|
||||||
//std::cout<<"open door id \""<<ref.mRef.mRefID<<"\""<<std::endl;
|
|
||||||
mMovement.mPosition[1] = 1;
|
|
||||||
}
|
|
||||||
// these lines break ranged combat distance keeping
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// mMovement.mPosition[1] = 1; // FIXME: oscillation?
|
|
||||||
//}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user