mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-27 14:42:25 +00:00
[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:
parent
39ce0178f9
commit
8fc7f3a732
@ -6939,15 +6939,17 @@ void Client::SendAlternateCurrencyValues()
|
|||||||
|
|
||||||
void Client::SendAlternateCurrencyValue(uint32 currency_id, bool send_if_null)
|
void Client::SendAlternateCurrencyValue(uint32 currency_id, bool send_if_null)
|
||||||
{
|
{
|
||||||
uint32 value = GetAlternateCurrencyValue(currency_id);
|
const auto value = GetAlternateCurrencyValue(currency_id);
|
||||||
if(value > 0 || (value == 0 && send_if_null)) {
|
if (value > 0 || send_if_null) {
|
||||||
auto outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(AltCurrencyUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(AltCurrencyUpdate_Struct));
|
||||||
AltCurrencyUpdate_Struct *update = (AltCurrencyUpdate_Struct*)outapp->pBuffer;
|
auto update = (AltCurrencyUpdate_Struct *) outapp->pBuffer;
|
||||||
update->opcode = 7;
|
update->opcode = 7;
|
||||||
strcpy(update->name, GetName());
|
|
||||||
update->currency_number = currency_id;
|
update->currency_number = currency_id;
|
||||||
update->amount = value;
|
update->amount = value;
|
||||||
update->unknown072 = 1;
|
update->unknown072 = 1;
|
||||||
|
|
||||||
|
strn0cpy(update->name, GetName(), sizeof(update->name));
|
||||||
|
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user