summaryrefslogtreecommitdiff
path: root/godot/scripts/ballistics/Cannonball.gd
diff options
context:
space:
mode:
authorAnson Bridges <bridges.anson@gmail.com>2022-09-30 11:20:16 -0400
committerAnson Bridges <bridges.anson@gmail.com>2022-09-30 11:20:16 -0400
commit4a17fde692b900393d796675bcf7011aa7399dad (patch)
tree5305dba808a7094192821736a379168cdb549843 /godot/scripts/ballistics/Cannonball.gd
parent7a1d857de96174dfa5a0fa40f8c14acbd2f651c2 (diff)
syncing off main
Diffstat (limited to 'godot/scripts/ballistics/Cannonball.gd')
-rw-r--r--godot/scripts/ballistics/Cannonball.gd4
1 files changed, 4 insertions, 0 deletions
diff --git a/godot/scripts/ballistics/Cannonball.gd b/godot/scripts/ballistics/Cannonball.gd
index 241fc7d..b41f104 100644
--- a/godot/scripts/ballistics/Cannonball.gd
+++ b/godot/scripts/ballistics/Cannonball.gd
@@ -15,6 +15,10 @@ func get_init_info():
return {"linear_velocity" : linear_velocity, "angular_velocity" : angular_velocity, "oldvel" : oldvel, "shooter" : shooter, "shooter_id" : shooter_id}
func _on_collision(body):
+ if is_network_master() and body.has_method("load_cannonball") and !body.loaded:
+ body.rpc("load_cannonball")
+ rpc("net_remove")
+ return
if is_network_master() and oldvel.length() > 20 and !damage_exceptions.has(body) and body.has_method("damage"):
body.rpc("damage", oldvel.length(), "BLUNT", [shooter_id, shooter], "using 'cannon'")
damage_exceptions.append(body)