mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
- Bug fix for moving while no keys are pressed
This commit is contained in:
parent
fc74ddace3
commit
c50e998801
@ -385,8 +385,10 @@ class ShipPilot(PhysicsWalker):
|
||||
|
||||
if reverse:
|
||||
# Decelerate while sails are up
|
||||
self.straightHeading -= dt * self.TURNING_BONUS_REDUCTION * 2.0
|
||||
#elif (self.__speed < minSpeed) and forward:
|
||||
if (self.straightHeading < 0):
|
||||
self.straightHeading -= dt * self.TURNING_BONUS_REDUCTION * 2.0
|
||||
else:
|
||||
self.straightHeading -= dt * self.TURNING_BONUS_REDUCTION * 4.0
|
||||
elif (self.straightHeading < minStraightSail) and forward:
|
||||
# If not at MinSpeed, Accelerate regardless
|
||||
self.straightHeading += dt * 1.5
|
||||
@ -399,7 +401,7 @@ class ShipPilot(PhysicsWalker):
|
||||
self.straightHeading = minStraightSail
|
||||
else:
|
||||
self.straightHeading -= dt * self.TURNING_BONUS_REDUCTION
|
||||
else:
|
||||
elif forward:
|
||||
# Add in the Straight Sailing Time
|
||||
self.straightHeading += dt
|
||||
|
||||
@ -407,8 +409,8 @@ class ShipPilot(PhysicsWalker):
|
||||
# Allow straightHeading to reach a negative value
|
||||
self.straightHeading = max(self.REVERSE_STRAIGHT_SAIL_BONUS_TIME, self.straightHeading)
|
||||
else:
|
||||
# Normally min straightHeading is 1.0
|
||||
self.straightHeading = max(1.0, min(self.STRAIGHT_SAIL_BONUS_TIME, self.straightHeading))
|
||||
# Normally min straightHeading is 0.0
|
||||
self.straightHeading = max(0.0, min(self.STRAIGHT_SAIL_BONUS_TIME, self.straightHeading))
|
||||
|
||||
# Straight Sailing Acceleration Bonus
|
||||
straightSailBonus = 0.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user