Fixed spook manager not actually filtering spawners based on sightlines

This commit is contained in:
Rob Kelly 2025-09-07 00:19:04 -06:00
parent 0740f08941
commit 2d91fd3082
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=26 format=3 uid="uid://ogcjwuvqo5rc"] [gd_scene load_steps=27 format=3 uid="uid://ogcjwuvqo5rc"]
[ext_resource type="Script" uid="uid://dir6earo8ftlp" path="res://levels/testing/beast_spawner_test/beast_spawner_test.gd" id="1_a4s6t"] [ext_resource type="Script" uid="uid://dir6earo8ftlp" path="res://levels/testing/beast_spawner_test/beast_spawner_test.gd" id="1_a4s6t"]
[ext_resource type="PackedScene" uid="uid://b47goj32i6sdh" path="res://src/ui/elements/input_prompt/input_prompt.tscn" id="2_pn3sm"] [ext_resource type="PackedScene" uid="uid://b47goj32i6sdh" path="res://src/ui/elements/input_prompt/input_prompt.tscn" id="2_pn3sm"]
@ -18,6 +18,7 @@
[ext_resource type="Texture2D" uid="uid://dkilg200w8x4y" path="res://assets/props/vending_machine/vending_machine_M.png" id="15_jafew"] [ext_resource type="Texture2D" uid="uid://dkilg200w8x4y" path="res://assets/props/vending_machine/vending_machine_M.png" id="15_jafew"]
[ext_resource type="Texture2D" uid="uid://8v7jta2qdvut" path="res://assets/props/vending_machine/vending_machine_N.png" id="16_smofw"] [ext_resource type="Texture2D" uid="uid://8v7jta2qdvut" path="res://assets/props/vending_machine/vending_machine_N.png" id="16_smofw"]
[ext_resource type="Texture2D" uid="uid://gbvtbiurxrop" path="res://assets/props/vending_machine/vending_machine_R.png" id="17_ks403"] [ext_resource type="Texture2D" uid="uid://gbvtbiurxrop" path="res://assets/props/vending_machine/vending_machine_R.png" id="17_ks403"]
[ext_resource type="PackedScene" uid="uid://ddmgqfhiv3aag" path="res://levels/ghost_ship/level/corridor_1/corridor_1.tscn" id="19_avb8e"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_hda7d"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_hda7d"]
@ -744,3 +745,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -40.5, 0.499, 13.5)
[node name="VendingMachine" parent="." instance=ExtResource("12_y2hej")] [node name="VendingMachine" parent="." instance=ExtResource("12_y2hej")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, -6) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, -6)
surface_material_override/0 = SubResource("StandardMaterial3D_mo4ho") surface_material_override/0 = SubResource("StandardMaterial3D_mo4ho")
[node name="Corridor1" parent="." instance=ExtResource("19_avb8e")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 27, 0, 28.5)

View File

@ -17,7 +17,7 @@ func _get_best_spawners() -> Array[BeastSpawner]:
) )
if visible_spawners: if visible_spawners:
# Get spawners the player is currently looking at # Get spawners the player is currently looking at
var seen_spawners := spawners.filter( var seen_spawners := visible_spawners.filter(
func(s: BeastSpawner) -> bool: func(s: BeastSpawner) -> bool:
return SceneTools.player_looking_at(s.global_position) return SceneTools.player_looking_at(s.global_position)
) )