Harden command zone tax counter handling and more clean up

- Initialize commandZoneGraphicsItem to nullptr so the pervasive null
    checks have defined behavior before initializeZones() runs
  - Remove unused getTaxCounterWidgets()
  - Enforce the "reset tax to 0 before deactivating" invariant server-side
    in cmdSetCounterActive, not just in the UI
  - Hide tax increment/decrement menu actions at their bounds (0 and
    MAX_COUNTER_VALUE) to avoid sending no-op commands
  - Drop redundant/inconsistent toggle labels from CommandZoneMenu::
    retranslateUi(); updateTaxCounterActionStates() owns them
  - Add default=-1 to Event_SetCounterActive.counter_id for parity with
    Command_SetCounterActive
This commit is contained in:
DawnFire42 2026-06-16 11:00:21 -04:00
parent 01399b3dfc
commit eefdb6a6f0
No known key found for this signature in database
GPG key ID: 24BB855EE2911B33
5 changed files with 13 additions and 25 deletions

View file

@ -259,17 +259,6 @@ void PlayerGraphicsItem::rearrangeCounters()
}
}
QList<AbstractCounter *> PlayerGraphicsItem::getTaxCounterWidgets() const
{
QList<AbstractCounter *> result;
for (AbstractCounter *ctr : counterWidgets.values()) {
if (CounterNames::isTaxCounter(ctr->getName())) {
result.append(ctr);
}
}
return result;
}
AbstractCounter *PlayerGraphicsItem::getTaxCounterIfActive(int counterId) const
{
AbstractCounter *counter = getCounterWidget(counterId);