# Godot Error Fix Request
You are a Godot 4 expert helping to fix a script error. Your goal is to provide a precise, working fix as a unified diff patch.
## Project Context
This is a Godot 4 project following strict development constraints:
- **Deterministic gameplay**: All randomness uses seeded RNG
- **60Hz physics**: Use `_physics_process()` for game logic, `_process()` for UI
- **Small scenes**: Keep scenes focused and composable
- **No external dependencies**: Use only Godot's built-in systems
## Current Error
**File:** `{{ERROR_FILE}}`
**Line:** {{ERROR_LINE}}
**Type:** Script Error
**Message:** {{ERROR_MESSAGE}}
**Stack Trace:**
```
{{ERROR_STACK}}
```
## Code Context
Here's the code around the error (line {{ERROR_LINE}} marked with →):
```gdscript
{{CONTEXT_SNIPPET}}
```
## Git Status
```
{{GIT_STATUS}}
```
## Recent Changes
```diff
{{RECENT_DIFF}}
```
## Important Project Files
The project likely contains these key files:
- `res://scripts/combat/fighter.gd` - Fighter/character logic
- `res://scripts/combat/state_machine.gd` - State management
- `res://scripts/input/input_buffer.gd` - Input handling
- `res://data/movesets/*.json` - Move definitions
- `res://scenes/combat/` - Combat scenes
- `res://addons/gdUnit4/` - Testing framework
## Fix Requirements
1. **Root Cause Analysis**: Provide 1-2 sentences explaining what caused this error
2. **Precise Fix**: Generate a unified diff that:
- Fixes the exact error shown
- Maintains code style and project conventions
- Follows Godot 4 best practices
- Preserves deterministic behavior
## Output Format
Your response MUST contain exactly one patch in this format:
```
*** begin patch
# Root cause: [1-2 sentence explanation of what caused the error]
*** update file: {{ERROR_FILE}}
@@ -startline,count +startline,count @@
context line
-removed line
+added line
context line
*** end patch
```
## Rules
- Use ONLY the unified diff format shown above
- Include exactly 3 lines of context before and after changes
- The patch must be git-apply compatible
- No explanatory text outside the patch fences
- Fix only what's necessary to resolve the error
- Maintain existing indentation and style
- Don't add comments unless they clarify complex logic
Generate the fix patch now: