mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-21 13:16:49 +01:00
Fix update_visibility in PlayerGDBase. Also fix spawn_for in the entity spawner.
This commit is contained in:
parent
3dd4f4592a
commit
f8803b99ab
@ -820,4 +820,5 @@ func teleport(teleport_to : Vector3):
|
||||
placed = false
|
||||
# just_place = true
|
||||
|
||||
|
||||
func get_entity() -> Entity:
|
||||
return entity
|
||||
|
@ -59,9 +59,16 @@ func update_visibility() -> void:
|
||||
for collision in res:
|
||||
var collider = collision["collider"]
|
||||
|
||||
if collider is Entity and not currenty_sees.has(collider):
|
||||
currenty_sees.append(collider)
|
||||
if !collider.has_method("get_entity"):
|
||||
continue
|
||||
|
||||
var entity : Entity = collider.get_entity()
|
||||
|
||||
if !entity:
|
||||
continue
|
||||
|
||||
if !currenty_sees.has(entity):
|
||||
currenty_sees.append(entity)
|
||||
|
||||
#warning-ignore:unassigned_variable
|
||||
var used_to_see : Array = Array()
|
||||
@ -71,7 +78,6 @@ func update_visibility() -> void:
|
||||
|
||||
used_to_see.append(ent)
|
||||
|
||||
|
||||
#warning-ignore:unassigned_variable
|
||||
var currenty_sees_filtered : Array = Array()
|
||||
|
||||
@ -86,7 +92,7 @@ func update_visibility() -> void:
|
||||
for e in used_to_see:
|
||||
var ent : Entity = e as Entity
|
||||
|
||||
if self.get_network_master() != 1:
|
||||
if get_network_master() != 1:
|
||||
ESS.entity_spawner.despawn_for(self, ent)
|
||||
|
||||
sees_removes(ent)
|
||||
@ -94,7 +100,7 @@ func update_visibility() -> void:
|
||||
for e in currenty_sees_filtered:
|
||||
var ent : Entity = e as Entity
|
||||
|
||||
if self.get_network_master() != 1:
|
||||
if get_network_master() != 1:
|
||||
ESS.entity_spawner.spawn_for(self, ent)
|
||||
|
||||
sees_adds(ent)
|
||||
|
@ -52,10 +52,12 @@ func on_network_peer_packet(id : int, packet : PoolByteArray) ->void:
|
||||
|
||||
func spawn_for(player : Entity, target: Entity) -> void:
|
||||
Logger.info("spawnfor " + target.name)
|
||||
rpc_id(player.get_network_master(), "creceive_spawn_for", to_json(target.to_dict()), target.name, target.translation)
|
||||
print("spawnfor " + target.name)
|
||||
rpc_id(player.get_network_master(), "creceive_spawn_for", to_json(target.to_dict()), target.name, target.get_transform_3d())
|
||||
|
||||
func despawn_for(player : Entity, target: Entity) -> void:
|
||||
Logger.info("despawnfor " + target.name)
|
||||
print("despawnfor " + target.name)
|
||||
rpc_id(player.get_network_master(), "creceive_despawn_for", target.get_path())
|
||||
|
||||
remote func creceive_spawn_for(data: String, global_name : String, position: Vector3) -> Entity:
|
||||
|
Loading…
Reference in New Issue
Block a user