summaryrefslogtreecommitdiff
path: root/godot/scripts/vehicles
diff options
context:
space:
mode:
Diffstat (limited to 'godot/scripts/vehicles')
-rw-r--r--godot/scripts/vehicles/Gunboat.gd8
1 files changed, 7 insertions, 1 deletions
diff --git a/godot/scripts/vehicles/Gunboat.gd b/godot/scripts/vehicles/Gunboat.gd
index c00479e..03252e6 100644
--- a/godot/scripts/vehicles/Gunboat.gd
+++ b/godot/scripts/vehicles/Gunboat.gd
@@ -39,12 +39,18 @@ func mp_init(init_info):
# Called when the node enters the scene tree for the first time.
func _ready():
print("adding gunboat to scene",get_tree().get_network_unique_id())
+ controllable = true
+ for sail in $SAILS.get_children():
+ sail.set_sheet(sail_out)
world = get_tree().get_root().find_node("GAMEWORLD", true, false)
if get_tree().get_network_unique_id() == 0:
print("enabling navigation for server")
$NavigationMeshInstance.set_enabled(true)
func on_no_control():
+ rpc("reset_controls")
+
+remotesync func reset_controls():
rudder = 0.0
throttle = 0.0
mainsheet = 0.0
@@ -76,7 +82,7 @@ remotesync func damage(amount, _type, _shooter, _extra = ""):
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
if is_network_master():
- if mainsheet != 0:
+ if throttle != 0:
for sail in $SAILS.get_children():
sail.set_sheet(sail_out)
$Rudder.rotation_degrees.y = rudder_turn