Use ID checks instead of name checks for tax counter validation in player actions

This commit is contained in:
DawnFire42 2026-08-10 19:27:03 -04:00
parent 4d972f4df5
commit 314b56d176
No known key found for this signature in database
GPG key ID: 24BB855EE2911B33

View file

@ -1716,7 +1716,7 @@ void PlayerActions::sendIncCounter(int counterId, int delta)
void PlayerActions::actModifyTaxCounter(int counterId, int delta) void PlayerActions::actModifyTaxCounter(int counterId, int delta)
{ {
CounterState *state = player->getCounters().value(counterId, nullptr); CounterState *state = player->getCounters().value(counterId, nullptr);
if (!state || !state->isActive() || !CounterNames::isTaxCounter(state->getName())) { if (!state || !state->isActive() || !CounterIds::isTaxCounter(counterId)) {
return; return;
} }
sendIncCounter(counterId, delta); sendIncCounter(counterId, delta);
@ -1725,7 +1725,7 @@ void PlayerActions::actModifyTaxCounter(int counterId, int delta)
void PlayerActions::actToggleTaxCounter(int counterId) void PlayerActions::actToggleTaxCounter(int counterId)
{ {
CounterState *state = player->getCounters().value(counterId, nullptr); CounterState *state = player->getCounters().value(counterId, nullptr);
if (!state || !CounterNames::isTaxCounter(state->getName())) { if (!state || !CounterIds::isTaxCounter(counterId)) {
return; return;
} }
// Prevent disabling a counter with tax accumulated; player must reset to 0 first // Prevent disabling a counter with tax accumulated; player must reset to 0 first