Fix headless class_name dependencies
- Replaced TeamData.Team type hints with int in all scripts - Added explicit preloads for headless mode class resolution - Created stub LagCompensation and DamageProcessor scripts - Fixed PluginManager, SpawnManager, EconomyManager, BuyZone, RoundManager, BuyMenuHandler, BombObjective class_name references - Updated server config to match ServerConfig.gd format Gray screen root cause: server scripts failed to parse in headless mode due to Godot 4 class_name loading order (Resource after Node), leaving server_main.gd non-functional — accepted connections but never spawned players.
This commit is contained in:
@@ -24,6 +24,9 @@
|
||||
extends Node
|
||||
class_name BombObjective
|
||||
|
||||
# Preload for headless compat
|
||||
const _td = preload("res://scripts/teams/team_data.gd")
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Signals
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -422,13 +425,13 @@ func _is_round_live() -> bool:
|
||||
func _is_player_terrorist(player_id: int) -> bool:
|
||||
if team_manager == null:
|
||||
return false
|
||||
return team_manager.get_player_team(player_id) == TeamData.Team.TERRORIST
|
||||
return team_manager.get_player_team(player_id) == _td.Team.TERRORIST
|
||||
|
||||
## Check if a player (by peer ID) is on the Counter-Terrorist team.
|
||||
func _is_player_counter_terrorist(player_id: int) -> bool:
|
||||
if team_manager == null:
|
||||
return false
|
||||
return team_manager.get_player_team(player_id) == TeamData.Team.COUNTER_TERRORIST
|
||||
return team_manager.get_player_team(player_id) == _td.Team.COUNTER_TERRORIST
|
||||
|
||||
## Check if a player is inside any registered bombsite.
|
||||
## Iterates bomb sites and checks if the player's body overlaps.
|
||||
|
||||
Reference in New Issue
Block a user