void swampslug_think(entity this)
{
//Slowly kill the slug
- this.health = this.health - 1;
+ SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH) - 1);
//Slug dead? then remove curses.
- if(this.health <= 0)
+ if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
{
this.owner.in_swamp = 0;
delete(this);
// If not attach one.
//centerprint(toucher,"Entering swamp!\n");
toucher.swampslug = spawn();
- toucher.swampslug.health = 2;
+ SetResourceAmountExplicit(toucher.swampslug, RESOURCE_HEALTH, 2);
setthink(toucher.swampslug, swampslug_think);
toucher.swampslug.nextthink = time;
toucher.swampslug.owner = toucher;
//toucher.in_swamp = 1;
//Revitalize players swampslug
- toucher.swampslug.health = 2;
+ SetResourceAmountExplicit(toucher.swampslug, RESOURCE_HEALTH, 2);
}
REGISTER_NET_LINKED(ENT_CLIENT_SWAMP)