Compare commits

...
This repository has been archived on 2022-01-09. You can view files and clone it, but cannot push or open issues/pull-requests.

1 Commits

Author SHA1 Message Date
unfa 7e870a7f30 Fixed death not working and crashing clients. 2021-09-19 21:13:28 +02:00
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()