[Cleanup] Cleanup unnecessary condition in Client::SendAlternateCurrencyValue() (#3266)

# Notes
- `value == 0` is unnecessary as it can only be 0 if we fail the `value > 0` check.
This commit is contained in:
Alex King 2023-04-05 10:27:01 -04:00 committed by GitHub
parent 39ce0178f9
commit 8fc7f3a732
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6939,15 +6939,17 @@ void Client::SendAlternateCurrencyValues()
void Client::SendAlternateCurrencyValue(uint32 currency_id, bool send_if_null)
{
uint32 value = GetAlternateCurrencyValue(currency_id);
if(value > 0 || (value == 0 && send_if_null)) {
const auto value = GetAlternateCurrencyValue(currency_id);
if (value > 0 || send_if_null) {
auto outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(AltCurrencyUpdate_Struct));
AltCurrencyUpdate_Struct *update = (AltCurrencyUpdate_Struct*)outapp->pBuffer;
update->opcode = 7;
strcpy(update->name, GetName());
auto update = (AltCurrencyUpdate_Struct *) outapp->pBuffer;
update->opcode = 7;
update->currency_number = currency_id;
update->amount = value;
update->unknown072 = 1;
update->amount = value;
update->unknown072 = 1;
strn0cpy(update->name, GetName(), sizeof(update->name));
FastQueuePacket(&outapp);
}
}