}
if(other.assault_sprite)
+ {
WaypointSprite_Disown(other.assault_sprite, waypointsprite_deadlifetime);
+ if(other.classname == "func_assault_destructible")
+ other.sprite = world;
+ }
else
return; // already activated! cannot activate again!
for(ent = world; (ent = find(ent, target, self.targetname)); )
{
if(ent.assault_sprite != world)
+ {
WaypointSprite_Disown(ent.assault_sprite, waypointsprite_deadlifetime);
+ if(ent.classname == "func_assault_destructible")
+ ent.sprite = world;
+ }
spr = WaypointSprite_SpawnFixed("<placeholder>", 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite);
spr.assault_decreaser = self;
spr.classname = "sprite_waypoint";
WaypointSprite_UpdateRule(spr, assault_attacker_team, SPRITERULE_TEAMPLAY);
if(ent.classname == "func_assault_destructible")
+ {
WaypointSprite_UpdateSprites(spr, "as-defend", "as-destroy", "as-destroy");
+ WaypointSprite_UpdateMaxHealth(spr, ent.max_health);
+ WaypointSprite_UpdateHealth(spr, ent.health);
+ ent.sprite = spr;
+ }
else
WaypointSprite_UpdateSprites(spr, "as-defend", "as-push", "as-push");
WaypointSprite_UpdateTeamRadar(spr, RADARICON_OBJECTIVE, '1 0.5 0');
void func_breakable_behave_restore()
{
self.health = self.max_health;
+ if(self.sprite)
+ {
+ WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
+ WaypointSprite_UpdateHealth(self.sprite, self.health);
+ }
self.takedamage = DAMAGE_AIM;
self.event_damage = func_breakable_damage;
self.state = 0;
if(self.team)
if(attacker.team == self.team)
return;
+ self.health = self.health - damage;
if(self.sprite)
+ {
WaypointSprite_Ping(self.sprite);
- self.health = self.health - damage;
+ WaypointSprite_UpdateHealth(self.sprite, self.health);
+ }
func_breakable_colormod();
if(self.health <= 0)