mirror of
https://github.com/SphereServer/Source-X
synced 2026-08-13 10:23:05 -04:00
Display percentual hitpoints in PacketObjectStatus (0x11) (#1573)
This commit is contained in:
parent
06de4e2bdc
commit
f265ee74bb
1 changed files with 4 additions and 4 deletions
|
|
@ -180,8 +180,8 @@ PacketObjectStatus::PacketObjectStatus(const CClient* target, CObjBase* object)
|
|||
if ( objectChar )
|
||||
{
|
||||
fCanRename = objectChar->IsOwnedBy(character);
|
||||
iHitsCurrent = (word)objectChar->Stat_GetVal(STAT_STR);
|
||||
iHitsMax = (word)objectChar->Stat_GetMaxAdjusted(STAT_STR);
|
||||
const ushort tmpMaxHits = objectChar->Stat_GetMaxAdjusted(STAT_STR);
|
||||
iHitsCurrent = static_cast<word>((objectChar->Stat_GetVal(STAT_STR) * 100) / maximum(tmpMaxHits, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -191,8 +191,8 @@ PacketObjectStatus::PacketObjectStatus(const CClient* target, CObjBase* object)
|
|||
CCItemDamageable *pItem = static_cast<CCItemDamageable*>(object->GetComponent(COMP_ITEMDAMAGEABLE));
|
||||
if (pItem)
|
||||
{
|
||||
iHitsCurrent = pItem->GetCurHits();
|
||||
iHitsMax = pItem->GetMaxHits();
|
||||
const ushort tmpMaxHits = pItem->GetMaxHits();
|
||||
iHitsCurrent = static_cast<word>((pItem->GetCurHits() * 100) / maximum(tmpMaxHits, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue