forked from mirror/openmw-tes3mp
Allow flying and swimming creatures to step inclines. Should have listen to Chris in the first place, see https://forum.openmw.org/viewtopic.php?f=6&t=2075
This commit is contained in:
parent
7f12733463
commit
d2a41167d0
1 changed files with 10 additions and 4 deletions
|
@ -308,11 +308,17 @@ namespace MWWorld
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ogre::Vector3 oldPosition = newPosition;
|
||||||
// We hit something. Try to step up onto it. (NOTE: stepMove does not allow stepping over)
|
// We hit something. Try to step up onto it. (NOTE: stepMove does not allow stepping over)
|
||||||
// NOTE: May need to stop slaughterfish step out of the water.
|
// NOTE: stepMove modifies newPosition if successful
|
||||||
// NOTE: stepMove may modify newPosition
|
if(stepMove(colobj, newPosition, velocity, remainingTime, engine))
|
||||||
if((canWalk || isBipedal || isNpc) && stepMove(colobj, newPosition, velocity, remainingTime, engine))
|
{
|
||||||
isOnGround = !(newPosition.z < waterlevel || isFlying); // Only on the ground if there's gravity
|
// don't let slaughterfish move out of water after stepMove
|
||||||
|
if(ptr.getClass().canSwim(ptr) && newPosition.z > (waterlevel - halfExtents.z * 0.5))
|
||||||
|
newPosition = oldPosition;
|
||||||
|
else // Only on the ground if there's gravity
|
||||||
|
isOnGround = !(newPosition.z < waterlevel || isFlying);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Can't move this way, try to find another spot along the plane
|
// Can't move this way, try to find another spot along the plane
|
||||||
|
|
Loading…
Reference in a new issue