]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/trigger/swamp.qc
Clear out .health and .armorvalue from the client side
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / swamp.qc
index 058e41ca278e0cad04833d247dc3c2ba6621265f..fd40e2f34db29d4a04e88dd69074742da043cfd8 100644 (file)
@@ -40,10 +40,10 @@ void swampslug_think(entity this);
 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);
@@ -76,7 +76,7 @@ void swamp_touch(entity this, entity toucher)
                // 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;
@@ -90,7 +90,7 @@ void swamp_touch(entity this, entity toucher)
        //toucher.in_swamp = 1;
 
        //Revitalize players swampslug
-       toucher.swampslug.health = 2;
+       SetResourceAmountExplicit(toucher.swampslug, RESOURCE_HEALTH, 2);
 }
 
 REGISTER_NET_LINKED(ENT_CLIENT_SWAMP)