summaryrefslogtreecommitdiff
path: root/godot/scripts/machines/Cannon.gd
diff options
context:
space:
mode:
Diffstat (limited to 'godot/scripts/machines/Cannon.gd')
-rw-r--r--godot/scripts/machines/Cannon.gd6
1 files changed, 3 insertions, 3 deletions
diff --git a/godot/scripts/machines/Cannon.gd b/godot/scripts/machines/Cannon.gd
index 80c32ef..b8d9f38 100644
--- a/godot/scripts/machines/Cannon.gd
+++ b/godot/scripts/machines/Cannon.gd
@@ -34,8 +34,8 @@ func mp_init(init_info):
# Called when the node enters the scene tree for the first time.
func _ready():
if get_parent().name != "MACHINES": #if cannon is aboard ship
- add_collision_exception_with(get_parent())
- mode = RigidBody.MODE_STATIC
+ add_collision_exception_with(get_parent().get_parent())
+ mode = RigidBody.MODE_KINEMATIC
world_ballistics = world.get_node("BALLISTICS")
func on_new_control():
@@ -75,7 +75,7 @@ remotesync func fire():
cball.shooter = user.name + " (" + world.players_info[user.get_network_master()][0] + ")"
cball.shooter_id = user.get_network_master()
cooldown = fire_rate
- if mode == RigidBody.MODE_STATIC:
+ if mode == RigidBody.MODE_KINEMATIC:
get_parent().apply_impulse($YawJoint/PitchJoint.global_transform.origin - get_parent().global_transform.origin, -1*cball.mass*ball_speed*muzzle.global_transform.basis.x)
else:
if is_network_master(): apply_impulse($YawJoint/PitchJoint.global_transform.origin - global_transform.origin, -1*cball.mass*ball_speed*muzzle.global_transform.basis.x)