mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -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:
|
if reverse:
|
||||||
# Decelerate while sails are up
|
# Decelerate while sails are up
|
||||||
|
if (self.straightHeading < 0):
|
||||||
self.straightHeading -= dt * self.TURNING_BONUS_REDUCTION * 2.0
|
self.straightHeading -= dt * self.TURNING_BONUS_REDUCTION * 2.0
|
||||||
#elif (self.__speed < minSpeed) and forward:
|
else:
|
||||||
|
self.straightHeading -= dt * self.TURNING_BONUS_REDUCTION * 4.0
|
||||||
elif (self.straightHeading < minStraightSail) and forward:
|
elif (self.straightHeading < minStraightSail) and forward:
|
||||||
# If not at MinSpeed, Accelerate regardless
|
# If not at MinSpeed, Accelerate regardless
|
||||||
self.straightHeading += dt * 1.5
|
self.straightHeading += dt * 1.5
|
||||||
@ -399,7 +401,7 @@ class ShipPilot(PhysicsWalker):
|
|||||||
self.straightHeading = minStraightSail
|
self.straightHeading = minStraightSail
|
||||||
else:
|
else:
|
||||||
self.straightHeading -= dt * self.TURNING_BONUS_REDUCTION
|
self.straightHeading -= dt * self.TURNING_BONUS_REDUCTION
|
||||||
else:
|
elif forward:
|
||||||
# Add in the Straight Sailing Time
|
# Add in the Straight Sailing Time
|
||||||
self.straightHeading += dt
|
self.straightHeading += dt
|
||||||
|
|
||||||
@ -407,8 +409,8 @@ class ShipPilot(PhysicsWalker):
|
|||||||
# Allow straightHeading to reach a negative value
|
# Allow straightHeading to reach a negative value
|
||||||
self.straightHeading = max(self.REVERSE_STRAIGHT_SAIL_BONUS_TIME, self.straightHeading)
|
self.straightHeading = max(self.REVERSE_STRAIGHT_SAIL_BONUS_TIME, self.straightHeading)
|
||||||
else:
|
else:
|
||||||
# Normally min straightHeading is 1.0
|
# Normally min straightHeading is 0.0
|
||||||
self.straightHeading = max(1.0, min(self.STRAIGHT_SAIL_BONUS_TIME, self.straightHeading))
|
self.straightHeading = max(0.0, min(self.STRAIGHT_SAIL_BONUS_TIME, self.straightHeading))
|
||||||
|
|
||||||
# Straight Sailing Acceleration Bonus
|
# Straight Sailing Acceleration Bonus
|
||||||
straightSailBonus = 0.0
|
straightSailBonus = 0.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user