mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 22:01:30 +00:00
[Cleanup] Fix check for !this in Client::SendHPUpdateMarquee() (#3257)
# Notes - `!this` isn't valid, as `this` can never be nullptr.
This commit is contained in:
parent
d33cfad567
commit
81314a3315
@ -8650,15 +8650,17 @@ void Client::RewardFaction(int id, int amount)
|
||||
}
|
||||
|
||||
void Client::SendHPUpdateMarquee(){
|
||||
if (!this || !IsClient() || !current_hp || !max_hp)
|
||||
if (!IsClient() || !current_hp || !max_hp) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Health Update Marquee Display: Custom*/
|
||||
uint8 health_percentage = (uint8)(current_hp * 100 / max_hp);
|
||||
if (health_percentage >= 100)
|
||||
const auto health_percentage = static_cast<uint8>(current_hp * 100 / max_hp);
|
||||
if (health_percentage >= 100) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string health_update_notification = StringFormat("Health: %u%%", health_percentage);
|
||||
const auto health_update_notification = fmt::format("Health: {}%%", health_percentage);
|
||||
SendMarqueeMessage(Chat::Yellow, 510, 0, 3000, 3000, health_update_notification);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user