]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/func/door_secret.qc
Merge branch 'master' into Lyberta/WaypointIcons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / func / door_secret.qc
index f06f39e91126e963fa507e139a19304bfbcb6453..50593a4e2b071df0bbe2c6238157e59c3c6c8dde 100644 (file)
@@ -13,7 +13,7 @@ void fd_secret_use(entity this, entity actor, entity trigger)
        float temp;
        string message_save;
 
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 10000);
+       SetResourceExplicit(this, RES_HEALTH, 10000);
        if(!this.bot_attack)
                IL_PUSH(g_bot_targets, this);
        this.bot_attack = true;
@@ -122,7 +122,7 @@ void fd_secret_done(entity this)
 {
        if (this.spawnflags&DOOR_SECRET_YES_SHOOT)
        {
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, 10000);
+               SetResourceExplicit(this, RES_HEALTH, 10000);
                this.takedamage = DAMAGE_YES;
                //this.th_pain = fd_secret_use;
        }
@@ -168,7 +168,7 @@ void secret_reset(entity this)
 {
        if (this.spawnflags & DOOR_SECRET_YES_SHOOT)
        {
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, 10000);
+               SetResourceExplicit(this, RES_HEALTH, 10000);
                this.takedamage = DAMAGE_YES;
        }
        setorigin(this, this.oldorigin);
@@ -244,16 +244,13 @@ spawnfunc(func_door_secret)
        setblocked(this, secret_blocked);
        this.speed = 50;
        this.use = fd_secret_use;
-       IFTARGETED
-       {
-       }
-       else
+       if(!this.targetname || this.targetname == "")
                this.spawnflags |= DOOR_SECRET_YES_SHOOT;
 
        if (this.spawnflags & DOOR_SECRET_YES_SHOOT)
        {
                //this.canteamdamage = true; // TODO
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, 10000);
+               SetResourceExplicit(this, RES_HEALTH, 10000);
                this.takedamage = DAMAGE_YES;
                this.event_damage = fd_secret_damage;
        }