[PR #8266] [MERGED] fix(game): a fight starts with a mechanic's interval or a status's duration at 0 #8254

Closed
opened 2026-10-26 04:04:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8266
Author: @kolacheee
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @kolacheee

Base: staging ← Head: fix/combat-start-accepts-zero


📝 Commits (3)

  • 6f2a7cb fix(game): a fight starts with a mechanic's interval or a status's duration at 0
  • 16262ed fix(game): say what a 0-turn status does, and join the refusal path once
  • 5d38f6c Merge remote-tracking branch 'origin/staging' into fix/combat-start-accepts-zero

📊 Changes

2 files changed (+35 additions, -3 deletions)

View changed files

📝 packages/server/src/routes/combat-director.routes.ts (+17 -3)
📝 scripts/regressions/combat-director-route.regression.ts (+18 -0)

📄 Description

Linked issue

Closes #8265

Why this change

  • A Game Master's hp_threshold mechanic can carry interval: 0. The battle start route required 1 or more, so the whole fight was refused with "Number must be greater than or equal to 1", naming no field and logging nothing. Reload battle hit the same 400.

What changed

  • A combat mechanic's interval and a status's duration accept 0 at battle start. The combat code already treats an interval of 0 as none, and a 0-turn status as the default length.
  • A refused battle start now logs the field it refused on the server and names a nested field in the error, such as mechanics.0.interval: Number must be greater than or equal to 0. Top-level messages like "This fight has nobody to fight." read as before.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • scripts/regressions/combat-director-route.regression.ts passes with a new case: a start carrying an hp_threshold mechanic at interval: 0 and a 0-turn status passes validation, and one at interval: -1 is refused as mechanics.0.interval: .... The case fails on staging without the fix.
  • tsc --noEmit on the server package and Prettier pass.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8266 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/combat-start-accepts-zero` --- ### 📝 Commits (3) - [`6f2a7cb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6f2a7cbe2c73a674737d918c7c46dd030d194ff4) fix(game): a fight starts with a mechanic's interval or a status's duration at 0 - [`16262ed`](https://github.com/Pasta-Devs/Marinara-Engine/commit/16262ede6aa07315e267e9a39c492d62b8c9659f) fix(game): say what a 0-turn status does, and join the refusal path once - [`5d38f6c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5d38f6c041cb765057b7465c2b466f62379d5a49) Merge remote-tracking branch 'origin/staging' into fix/combat-start-accepts-zero ### 📊 Changes **2 files changed** (+35 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/combat-director.routes.ts` (+17 -3) 📝 `scripts/regressions/combat-director-route.regression.ts` (+18 -0) </details> ### 📄 Description ## Linked issue Closes #8265 ## Why this change - A Game Master's `hp_threshold` mechanic can carry `interval: 0`. The battle start route required 1 or more, so the whole fight was refused with "Number must be greater than or equal to 1", naming no field and logging nothing. Reload battle hit the same 400. ## What changed - A combat mechanic's `interval` and a status's `duration` accept 0 at battle start. The combat code already treats an interval of 0 as none, and a 0-turn status as the default length. - A refused battle start now logs the field it refused on the server and names a nested field in the error, such as `mechanics.0.interval: Number must be greater than or equal to 0`. Top-level messages like "This fight has nobody to fight." read as before. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - `scripts/regressions/combat-director-route.regression.ts` passes with a new case: a start carrying an `hp_threshold` mechanic at `interval: 0` and a 0-turn status passes validation, and one at `interval: -1` is refused as `mechanics.0.interval: ...`. The case fails on staging without the fix. - `tsc --noEmit` on the server package and Prettier pass. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 04:04:08 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8254
No description provided.