]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/func/door.qc
Purge SetResourceAmountExplicit
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / func / door.qc
index b7418298cbe7f05d45392770e5e2b3a9ed7bb4b9..3aaf047a31a9b59e38c5aaeedc583c6a7097f7c8 100644 (file)
@@ -113,7 +113,7 @@ void door_go_down(entity this)
        if (this.max_health)
        {
                this.takedamage = DAMAGE_YES;
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+               SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
        }
 
        this.state = STATE_DOWN;
@@ -275,7 +275,7 @@ void door_damage(entity this, entity inflictor, entity attacker, float damage, i
 
        if (GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
        {
-               SetResourceAmountExplicit(this.owner, RESOURCE_HEALTH, this.owner.max_health);
+               SetResourceAmount(this.owner, RESOURCE_HEALTH, this.owner.max_health);
                this.owner.takedamage = DAMAGE_NO;      // will be reset upon return
                door_use(this.owner, attacker, NULL);
        }
@@ -475,7 +475,7 @@ void LinkDoors(entity this)
        for(t = this; ; t = t.enemy)
        {
                if(GetResourceAmount(t, RESOURCE_HEALTH) && !GetResourceAmount(this, RESOURCE_HEALTH))
-                       SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(t, RESOURCE_HEALTH));
+                       SetResourceAmount(this, RESOURCE_HEALTH, GetResourceAmount(t, RESOURCE_HEALTH));
                if((t.targetname != "") && (this.targetname == ""))
                        this.targetname = t.targetname;
                if((t.message != "") && (this.message == ""))
@@ -499,7 +499,7 @@ void LinkDoors(entity this)
        // distribute health, targetname, message
        for(t = this; t; t = t.enemy)
        {
-               SetResourceAmountExplicit(t, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
+               SetResourceAmount(t, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
                t.targetname = this.targetname;
                t.message = this.message;
                if(t.enemy == this)
@@ -595,8 +595,6 @@ float door_send(entity this, entity to, float sf)
 
 void door_link()
 {
-       // set size now, as everything is loaded
-       //FixSize(this);
        //Net_LinkEntity(this, false, 0, door_send);
 }
 #endif
@@ -715,9 +713,6 @@ spawnfunc(func_door)
        setblocked(this, door_blocked);
        this.use = door_use;
 
-       this.pos1 = this.origin;
-       this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
-
        if(this.spawnflags & DOOR_NONSOLID)
                this.solid = SOLID_NOT;
 
@@ -728,6 +723,9 @@ spawnfunc(func_door)
 
        door_init_shared(this);
 
+       this.pos1 = this.origin;
+       this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
+
        if (!this.speed)
        {
                this.speed = 100;