Skip to content

Crowd Control Updates & Ammo Quantity fixes - #7493

Merged
serprex merged 1 commit into
HarbourMasters:develop-deweyfrom
jaku:develop-dewey
Nov 22, 2026
Merged

serprex merged 1 commit into
HarbourMasters:develop-deweyfrom
jaku:develop-dewey

Conversation

@jaku

@jaku jaku commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Crowd Control was running effects on its own thread and touching game state (spawning actors, inventory, player) while the game was mid-frame, which could cause random crashes. It also had a hang on disconnect: OnDisconnected joined the effects thread, but that thread kept looping while CC was still enabled, so the network thread never came back.

Crowd Control

  • Incoming payloads are queued on the network thread and run on the game thread in OnGameFrameUpdate. Responses go the other way: they're queued on the game thread and sent from the network thread in ProcessOutgoingPackets.
  • Timed effects tick once per second off the frame hook instead of a sleeping thread. Each tick advances the timer by exactly one second so effects don't run longer than the CC overlay timer.
  • Disabling CC from the menu now removes any active timed effects. Before, they would stay on forever (e.g. decrease speed stuck at half speed). If removal isn't possible right then (textbox, cutscene, paused), it keeps retrying each frame until it works.
  • Expired effects are only dropped once removal actually succeeds. Previously, an effect that ran out during a textbox could stay applied for good.
  • A connection hiccup doesn't clear anything, so queued effects still run and status updates are sent once it reconnects. A manual disable clears everything.
  • Added crowd control mod version reporting

Ammo

  • Taking more bombchus or beans than you had left a negative ammo count, which crashed when the ammo digits were drawn (_gAmmoDigit0Tex out of bounds). Both are now clamped at 0 like the other ammo types.
  • Negative counts are also clamped when drawing on the HUD and the pause screen, so saves that already have a negative count don't crash.
  • Left comments about counts over 99 (still out of bounds when drawing) and about s8 overflow in Inventory_ChangeAmmo on large changes. Didn't change those here.

Build Artifacts

Comment thread soh/src/boot/build.c.in Outdated
#include <libultraship/libultra.h>

const char gBuildVersion[] = "@PROJECT_BUILD_NAME@ (@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@.@CMAKE_PROJECT_VERSION_PATCH@)";
const char gBuildName[] = "@PROJECT_BUILD_NAME@";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend against this, version is all you need

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't completely disagree, and won't ask you to include this if you think otherwise.

But we've had a lot of users using forks of SoH and then reporting bugs, so we were hoping to have a bit more info about the build they are using when this happens so we know where to target PRs and fixes.

If you have a another idea on how to accomplish that, it would be useful but with just version number it won't tell us enough.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect forks to end up with same build names, so don't think this will fix your issue either. You have example fork this is meant to differentiate? Commit hash could work

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with just a hash since that should for sure be different and would be enough for us to get some data. Thanks.

@serprex serprex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can fix formatting issues in a couple weeks when I'm back

…o counts

Queue network payloads for game-thread processing, retry timed-effect cleanup after disabling, and clamp negative ammo counts before drawing.

Report commit hash to Crowd Control
@serprex

serprex commented Nov 22, 2026

Copy link
Copy Markdown
Member

fixed formatting & adjusted ammo fix to be handled in protocol handling rather than in soh/src

@serprex
serprex merged commit 4017a60 into HarbourMasters:develop-dewey Nov 22, 2026
7 checks passed
Klebestreifen added a commit to Klebestreifen/Klebis-Shipwright that referenced this pull request Nov 30, 2026
## Merged from `develop`
* HarbourMasters#7551
* HarbourMasters#7555
* HarbourMasters#7521
* HarbourMasters#7520
* HarbourMasters#7491
* HarbourMasters#7443
* HarbourMasters#7433
* HarbourMasters#7505
* HarbourMasters#7261
* HarbourMasters#7493
* HarbourMasters#7441
* HarbourMasters#7545
* HarbourMasters#7547
* HarbourMasters#7546
* HarbourMasters#7548
* HarbourMasters#7470
* HarbourMasters#7550
* HarbourMasters#7455
* HarbourMasters#7559
* HarbourMasters#7560
* HarbourMasters#7561
* HarbourMasters#7563

## Own changes
* Navigation functionality for the entrance tracke (feb5669)
* Savegame migration (af67bfa, 7e3c664)
* Fix Bug where the check tracker duplicates checks in list after
  file_select dev command (4a8b092)
* Extend the Autosave feature with mor triggers (685579c, 50212ce)
Klebestreifen added a commit to Klebestreifen/Klebis-Shipwright that referenced this pull request Dec 1, 2026
## Merged from `develop`
* HarbourMasters#7551
* HarbourMasters#7555
* HarbourMasters#7521
* HarbourMasters#7520
* HarbourMasters#7491
* HarbourMasters#7443
* HarbourMasters#7433
* HarbourMasters#7505
* HarbourMasters#7261
* HarbourMasters#7493
* HarbourMasters#7441
* HarbourMasters#7545
* HarbourMasters#7547
* HarbourMasters#7546
* HarbourMasters#7548
* HarbourMasters#7470
* HarbourMasters#7550
* HarbourMasters#7455
* HarbourMasters#7559
* HarbourMasters#7560
* HarbourMasters#7561
* HarbourMasters#7563

## Own changes
* Navigation functionality for the entrance tracker (feb5669)
* Savegame migration (af67bfa, 7e3c664)
* Fix Bug where the check tracker duplicates checks in list after
  file_select dev command (4a8b092)
* Extend the Autosave feature with morr triggers (685579c, 50212ce)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants