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

actorid
cc9cii 11 years ago
parent 7f12733463
commit d2a41167d0

@ -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…
Cancel
Save