]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/trigger/multi.qc
Rename sv_vq3compat to sv_q3defragcompat to clarify its purpose
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / multi.qc
index 5447b992c373e1c1694b7e5bacb926cd8953f2e9..df915a649695c34ade16a31051dc9bdb6ce02b32 100644 (file)
@@ -7,7 +7,7 @@ void multi_wait(entity this)
 {
        if (this.max_health)
        {
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+               SetResourceExplicit(this, RES_HEALTH, this.max_health);
                this.takedamage = DAMAGE_YES;
                this.solid = SOLID_BBOX;
        }
@@ -24,7 +24,7 @@ void multi_trigger(entity this)
                return;         // allready been triggered
        }
 
-       if(this.spawnflags & ONLY_PLAYERS && !IS_PLAYER(this.enemy))
+       if((this.spawnflags & ONLY_PLAYERS) && !IS_PLAYER(this.enemy))
        {
                return; // only players
        }
@@ -120,8 +120,8 @@ void multi_eventdamage(entity this, entity inflictor, entity attacker, float dam
        if(this.team)
                if(((this.spawnflags & INVERT_TEAMS) == 0) == (this.team != attacker.team))
                        return;
-       TakeResource(this, RESOURCE_HEALTH, damage);
-       if (GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
+       TakeResource(this, RES_HEALTH, damage);
+       if (GetResource(this, RES_HEALTH) <= 0)
        {
                this.enemy = attacker;
                this.goalentity = inflictor;
@@ -135,7 +135,7 @@ void multi_reset(entity this)
                settouch(this, multi_touch);
        if (this.max_health)
        {
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+               SetResourceExplicit(this, RES_HEALTH, this.max_health);
                this.takedamage = DAMAGE_YES;
                this.solid = SOLID_BBOX;
        }
@@ -176,17 +176,20 @@ spawnfunc(trigger_multiple)
                this.wait = 0;
        this.use = multi_use;
 
+       if(this.wait == -1 && autocvar_sv_q3defragcompat)
+               this.wait = 0.1; // compatibility for q3df: "instant" return
+
        EXACTTRIGGER_INIT;
 
        this.team_saved = this.team;
        IL_PUSH(g_saved_team, this);
 
-       if (GetResourceAmount(this, RESOURCE_HEALTH))
+       if (GetResource(this, RES_HEALTH))
        {
                if (this.spawnflags & SPAWNFLAG_NOTOUCH)
                        objerror (this, "health and notouch don't make sense\n");
                this.canteamdamage = true;
-               this.max_health = GetResourceAmount(this, RESOURCE_HEALTH);
+               this.max_health = GetResource(this, RES_HEALTH);
                this.event_damage = multi_eventdamage;
                this.takedamage = DAMAGE_YES;
                this.solid = SOLID_BBOX;