mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 00:01:28 +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(){
|
void Client::SendHPUpdateMarquee(){
|
||||||
if (!this || !IsClient() || !current_hp || !max_hp)
|
if (!IsClient() || !current_hp || !max_hp) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Health Update Marquee Display: Custom*/
|
/* Health Update Marquee Display: Custom*/
|
||||||
uint8 health_percentage = (uint8)(current_hp * 100 / max_hp);
|
const auto health_percentage = static_cast<uint8>(current_hp * 100 / max_hp);
|
||||||
if (health_percentage >= 100)
|
if (health_percentage >= 100) {
|
||||||
return;
|
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);
|
SendMarqueeMessage(Chat::Yellow, 510, 0, 3000, 3000, health_update_notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user