if (WaypointSprite_isteammate(this.owner, WaypointSprite_getviewentity(to)))
{
- float dt = (this.waypointsprite_helpmetime - time) / 0.1;
- if (dt < 0)
- dt = 0;
- if (dt > 255)
- dt = 255;
+ float dt = bound(0, (this.waypointsprite_helpmetime - time) / 0.1, 255);
WriteByte(MSG_ENTITY, dt);
}
else
void WaypointSprite_UpdateHealth(entity e, float f)
{
f = bound(0, f, e.max_health);
- if (f != GetResourceAmount(e, RESOURCE_HEALTH) || e.pain_finished)
+ float step = e.max_health / 40;
+ if ((floor(f / step) != floor(GetResourceAmount(e, RESOURCE_HEALTH)) / step) || e.pain_finished)
{
SetResourceAmountExplicit(e, RESOURCE_HEALTH, f);
e.pain_finished = 0;