fix: Godot 4.2.1 compat and map builder fixes

- Fix tab character in _build_elevated_walkways() call (line 63)
- Fix untyped 'pos' variable in grapple pillar loop (line 376)
- Remove fog_sky_affinity (Godot 4.3+ only property)
- Replace preload() with load() for runtime script loading
- Replace 'is DoubleBarrelShotgun' type check with duck-typing
- Fix 'is not OfflineMultiplayerPeer' syntax in grenade spawn
- Replace absf() with abs() in state_machine, state_air, state_ground
- Update test_level.tscn to remove stale UID reference

All fixes verified: PARSE OK and scene runs without script errors
on Godot 4.2.1 headless.
This commit is contained in:
2026-06-21 01:24:42 -04:00
parent f164afecd8
commit 462d12bee5
6 changed files with 15 additions and 16 deletions
+4 -5
View File
@@ -60,7 +60,7 @@ func _build_geometry() -> void:
_build_outer_walls()
_build_central_structure()
_build_corner_towers()
-build_elevated_walkways()
_build_elevated_walkways()
_build_ramps()
_build_stepping_stones()
_build_wall_run_surfaces()
@@ -151,7 +151,6 @@ func _build_environment() -> void:
environment.fog_enabled = true
environment.fog_light_color = Color(0.45, 0.48, 0.55)
environment.fog_density = 0.003
environment.fog_sky_affinity = 0.5
env.environment = environment
add_child(env)
@@ -374,7 +373,7 @@ func _build_grapple_anchors() -> void:
Vector3(0, 0, 30),
]
for i in range(pillar_positions.size()):
var pos := pillar_positions[i]
var pos: Vector3 = pillar_positions[i]
# Pillar shaft (15u tall)
_box_static(pos + Vector3(0, 7.5, 0), Vector3(2, 15, 2), C_METAL, "GrapplePillar_%d" % i)
# Pillar top (grapple target marker)
@@ -689,7 +688,7 @@ func _spawn_player(pid: int) -> CharacterBody3D:
player.add_child(col_shape)
# Apply movement controller script
var mover_script = preload("res://movement/player_movement_controller.gd")
var mover_script = load("res://movement/player_movement_controller.gd")
if mover_script:
player.set_script(mover_script)
@@ -1066,7 +1065,7 @@ func _process(_delta: float) -> void:
if "weapon_name" in active_weapon:
w_name = active_weapon.weapon_name
elif active_weapon is DoubleBarrelShotgun:
elif active_weapon.get("weapon_name") == null and "shells" in active_weapon:
w_name = "Double Barrel Shotgun"
if "current_ammo" in active_weapon: