Fixed death not working and crashing clients.

remotes/1711838479790756977/tmp_refs/heads/fixing-death
unfa 2021-09-19 21:13:28 +02:00
parent a6a181049a
commit 7e870a7f30
2 changed files with 4 additions and 4 deletions

View File

@ -33,8 +33,8 @@ var impact_player = preload("res://Assets/Effects/ImpactBlood.tscn")
if ray: # did we hit anything?
if ray['collider'].has_method(&'damage'):
if is_network_authority(): #get_tree().multiplayer.get_network_unique_id() == 1: # make sure this can only run on the server
#print("SHOT HIT ", ray['collider'])
if get_tree().multiplayer.get_network_unique_id() == 1: # make sure this can only run on the server
print("SHOT HIT ", ray['collider'])
ray['collider'].damage(20) # apply damage
if main.player_list.get(ray['collider'].get_network_authority()).health <= 0: # if he ded
ray['collider'].die(self.get_network_authority())

View File

@ -6,8 +6,8 @@ enum NetworkRole {NONE, CLIENT, SERVER, DEDICATED_SERVER, RELAY_SERVER}
const NET_PORT = 12597
const NET_SERVER = "liblast.unfa.xyz"
#const NET_SERVER = "localhost"
#const NET_SERVER = "liblast.unfa.xyz"
const NET_SERVER = "localhost"
var peer = ENetMultiplayerPeer.new()