fix(client): address PR #141 review — parse-order, tween guard, test fixes
- Fix autoload parse-order violations: sim_bridge.gd, input_mapper.gd, audio_manager.gd now use load() for class_name types instead of direct references (LocalBridge, ServerProcess, Constants) - Collapse redundant tween validity guard in dialogue_box.gd to is_instance_valid(panel) only - Add clarifying comments to fog test resize assertions (8-tile padding trigger, 32x32 fixture assumption) - Fix test_examine_display_sprint18 case 2: GameState.has() → "field" in GameState (Node vs Dictionary API) - Fix test_game_state_sprint20: rename before_each → before_test (GdUnit4 lifecycle hook) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -184,10 +184,11 @@ func _update_facing_from_mouse() -> void:
|
||||
if vp == null:
|
||||
return
|
||||
var canvas_xf := vp.get_canvas_transform()
|
||||
var player_world_px := GameState.player_position * Constants.TILE_SIZE
|
||||
var player_screen := canvas_xf * player_world_px
|
||||
var mouse_screen := vp.get_mouse_position()
|
||||
var delta := mouse_screen - player_screen
|
||||
var C := load("res://scripts/constants.gd")
|
||||
var player_world_px: Vector2 = GameState.player_position * C.TILE_SIZE
|
||||
var player_screen: Vector2 = canvas_xf * player_world_px
|
||||
var mouse_screen: Vector2 = vp.get_mouse_position()
|
||||
var delta: Vector2 = mouse_screen - player_screen
|
||||
# Only update if mouse is meaningfully distant from player (avoid jitter at center)
|
||||
if delta.length_squared() > 4.0:
|
||||
facing_angle = delta.angle()
|
||||
|
||||
Reference in New Issue
Block a user