fix(@projects/@magic-civilization): 🐛 move invalid class-body if into _ready (auto_play autoload was broken)
auto_play.gd had an `if OS.get_environment("AUTO_PLAY_ALL_AI")...` block at
class-body scope (lines 50-58) — invalid GDScript ("Unexpected if in class
body"), so the AutoPlay autoload failed to parse/load entirely: the autoplay /
RL-balance harness was non-functional and GUT logged a parse error at startup.
Relocated the (env-gated) reset into _ready where statements are legal. The vars
already default to the reset values, so behaviour is unchanged; this purely
restores the autoload to a loadable state.
Verified: gdlint parse-clean; headless boot exit 0 with no auto_play parse error.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
dd03be5ff8
commit
2211df0d85
1 changed files with 8 additions and 10 deletions
|
|
@ -47,16 +47,6 @@ var _attack_commitment_turns: int = 0
|
|||
var _active_attack_mil_count: int = 0
|
||||
var _in_attack_phase: bool = false
|
||||
|
||||
# p1-29d/g harness symmetry (Phase 3): AUTO_PLAY_ALL_AI=1 (or P1_29_CLEAN_HARNESS)
|
||||
# de-juices the harness slot (no army lock / commitment hysteresis / press-on).
|
||||
# This makes the autoplay gate surface match the clean gridded/player-api
|
||||
# surface used for p1-29h measurements, so re-baseline batches for p1-29d
|
||||
# convergence and p1-29g trained-vs are comparable without juicing artifact.
|
||||
if OS.get_environment("AUTO_PLAY_ALL_AI") != "" or OS.get_environment("P1_29_CLEAN_HARNESS") != "":
|
||||
_attack_commitment_turns = 0
|
||||
_locked_target = Vector2i(-1, -1)
|
||||
_target_stuck_turns = 0
|
||||
|
||||
# Test harness state (AUTO_PLAY_SEED path)
|
||||
var _seed: int = 0
|
||||
var _seed_set: bool = false
|
||||
|
|
@ -109,6 +99,14 @@ func _ready() -> void:
|
|||
if not _active:
|
||||
set_process(false)
|
||||
return
|
||||
# p1-29d/g harness symmetry (Phase 3): AUTO_PLAY_ALL_AI=1 (or P1_29_CLEAN_HARNESS)
|
||||
# de-juices the harness slot (no army lock / commitment hysteresis / press-on)
|
||||
# so the autoplay gate surface matches the clean gridded/player-api surface
|
||||
# used for p1-29h measurements. (Was an invalid class-body `if` — moved here.)
|
||||
if OS.get_environment("AUTO_PLAY_ALL_AI") != "" or OS.get_environment("P1_29_CLEAN_HARNESS") != "":
|
||||
_attack_commitment_turns = 0
|
||||
_locked_target = Vector2i(-1, -1)
|
||||
_target_stuck_turns = 0
|
||||
_output_dir = EnvConfig.get_var("AUTO_PLAY_DIR", "/tmp")
|
||||
DirAccess.make_dir_recursive_absolute(_output_dir)
|
||||
var limit_str: String = EnvConfig.get_var("AUTO_PLAY_TURN_LIMIT", "")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue