fix(client): address PR #22 review — 3 critical bugs, 2 warnings, 8 suggestions
Critical fixes: - fog_state: guard _compute_bounds() against all-invalid tiles (negative Rect2i crash) - fog_shader: read Camera2D zoom dynamically instead of hardcoded Vector2(2,2) - world_radial: set custom_minimum_size in _ready() from spoke geometry Warnings: - fog.gdshader: tighten PERIPHERAL_LOW 0.15→0.55 to match D-059 peripheral band - Extract color_for_entity_kind() to Constants.gd, decouple CursorRenderer from EntityRenderer Documentation: shallow copy assumption, gradual decay TODO, tween guard rationale, fade timing rationale, ToggleInsert TODO, monologue consume-once, hover offset safety, v6 fixture gap TODO. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,7 +43,8 @@ func update_fog() -> void:
|
||||
|
||||
# 2. Position ColorRect to cover the current viewport
|
||||
var vp_size := get_viewport().get_visible_rect().size
|
||||
var zoom := Vector2(2.0, 2.0) # Must match Camera2D zoom
|
||||
var cam := get_viewport().get_camera_2d()
|
||||
var zoom := cam.zoom if cam else Vector2(2.0, 2.0)
|
||||
var camera_pos := GameState.player_position * TILE_SIZE
|
||||
var half_view := vp_size / (2.0 * zoom)
|
||||
_fog_rect.position = camera_pos - half_view
|
||||
|
||||
Reference in New Issue
Block a user