mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
don't clear the global controlForce's physicsObject if some other code has set it to move something else
This commit is contained in:
parent
2ac571f424
commit
ae64fbe298
@ -77,6 +77,12 @@ class ShipPilot(PhysicsWalker):
|
|||||||
|
|
||||||
def setAvatar(self, ship):
|
def setAvatar(self, ship):
|
||||||
if ship is None:
|
if ship is None:
|
||||||
|
# only clear out the global controlForce's physics object if it hasn't
|
||||||
|
# been changed since we set it up for our boat
|
||||||
|
# this could still break if we have more than one ShipPilot referencing
|
||||||
|
# a single boat
|
||||||
|
if (self.ship is not None and
|
||||||
|
base.controlForce.getPhysicsObject() is self.ship.node().getPhysicsObject()):
|
||||||
base.controlForce.clearPhysicsObject()
|
base.controlForce.clearPhysicsObject()
|
||||||
base.controlForce.setVector(Vec3(0))
|
base.controlForce.setVector(Vec3(0))
|
||||||
self.takedownPhysics()
|
self.takedownPhysics()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user