]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Effects: fix arc with mismatching effectinfo
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 3 Nov 2015 11:50:32 +0000 (22:50 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 3 Nov 2015 11:50:32 +0000 (22:50 +1100)
qcsrc/common/effects/all.inc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc

index 052f753d63ca99b3724e3050ff313e547fc84d58..72d4565e4f8c0f9f6f90e52902f96afb874a325b 100644 (file)
@@ -23,6 +23,9 @@ EFFECT(0, ARC_BEAM,                 "arc_beam")
 EFFECT(0, ARC_BEAM_HEAL,            "arc_beam_heal")
 EFFECT(0, ARC_BEAM_HEAL_IMPACT,     "arc_beam_healimpact")
 EFFECT(0, ARC_BEAM_HEAL_IMPACT2,    "healray_impact")
+EFFECT(0, ARC_OVERHEAT,             "arc_overheat")
+EFFECT(0, ARC_OVERHEAT_FIRE,        "arc_overheat_fire")
+EFFECT(0, ARC_SMOKE,                "arc_smoke")
 EFFECT(0, ARC_LIGHTNING,            "arc_lightning")
 EFFECT(0, ARC_LIGHTNING2,           "electro_lightning")
 
@@ -220,6 +223,16 @@ EFFECT(1, PASS_BLUE,                "blue_pass")
 EFFECT(1, PASS_YELLOW,              "yellow_pass")
 EFFECT(1, PASS_PINK,                "pink_pass")
 EFFECT(1, PASS_NEUTRAL,             "neutral_pass")
+entity EFFECT_PASS(int teamid)
+{
+    switch (teamid) {
+        case NUM_TEAM_1:    return EFFECT_PASS_RED;
+        case NUM_TEAM_2:    return EFFECT_PASS_BLUE;
+        case NUM_TEAM_3:    return EFFECT_PASS_YELLOW;
+        case NUM_TEAM_4:    return EFFECT_PASS_PINK;
+        default:            return EFFECT_PASS_NEUTRAL;
+    }
+}
 
 EFFECT(0, CAP_RED,                  "red_cap")
 EFFECT(0, CAP_BLUE,                 "blue_cap")
index a9fc3fdb6e048a24afdbf518862f5314db748674..6b7330e589588048508cf4014aa4654223294fab 100644 (file)
@@ -267,7 +267,7 @@ void W_Arc_Beam_Think(void)
 
                        if ( WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max) )
                        {
-                               Send_Effect_("arc_overheat",
+                               Send_Effect(EFFECT_ARC_OVERHEAT,
                                        self.beam_start, self.beam_wantdir, 1 );
                                sound(self, CH_WEAPON_A, SND_ARC_STOP, VOL_BASE, ATTN_NORM);
                        }
@@ -607,10 +607,10 @@ void Arc_Smoke()
        if ( self.arc_overheat > time )
        {
                if ( random() < self.arc_heat_percent )
-                       Send_Effect_("arc_smoke", smoke_origin, '0 0 0', 1 );
+                       Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
                if ( self.BUTTON_ATCK || self.BUTTON_ATCK2 )
                {
-                       Send_Effect_("arc_overheat_fire", smoke_origin, w_shotdir, 1 );
+                       Send_Effect(EFFECT_ARC_OVERHEAT_FIRE, smoke_origin, w_shotdir, 1 );
                        if ( !self.arc_smoke_sound )
                        {
                                self.arc_smoke_sound = 1;
@@ -623,7 +623,7 @@ void Arc_Smoke()
        {
                if ( random() < (self.arc_beam.beam_heat-WEP_CVAR(arc, overheat_min)) /
                                ( WEP_CVAR(arc, overheat_max)-WEP_CVAR(arc, overheat_min) ) )
-                       Send_Effect_("arc_smoke", smoke_origin, '0 0 0', 1 );
+                       Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
        }
 
        if (  self.arc_smoke_sound && ( self.arc_overheat <= time ||
index 61c02138435e8d4b98f195a1ca1e357d040d9fb7..5e05a8e6432fd0ae066f385206de786c1879c5d0 100644 (file)
@@ -1357,12 +1357,6 @@ void ctf_DelayedFlagSetup(void) // called after a flag is placed on a map by ctf
        ctf_CaptureShield_Spawn(self);
 }
 
-void set_flag_string(entity flag, .string field, string value, string teamname)
-{
-       if(flag.(field) == "")
-               flag.(field) = strzone(sprintf(value,teamname));
-}
-
 void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag entity on the map as a spawnfunc
 {SELFPARAM();
        // declarations
@@ -1403,9 +1397,9 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e
        if(!flag.scale)                         { flag.scale = FLAG_SCALE; }
        if(flag.skin == 0)                      { flag.skin = cvar(sprintf("g_ctf_flag_%s_skin", teamname)); }
        if(flag.model == "")            { flag.model = cvar_string(sprintf("g_ctf_flag_%s_model", teamname)); }
-       set_flag_string(flag, toucheffect,      "%sflag_touch", teamname);
-       set_flag_string(flag, passeffect,       "%s_pass",              teamname);
-       set_flag_string(flag, capeffect,        "%s_cap",               teamname);
+       if (flag.toucheffect == "") { flag.toucheffect = EFFECT_FLAG_TOUCH(teamnumber).eent_eff_name; }
+       if (flag.passeffect == "")      { flag.passeffect = EFFECT_PASS(teamnumber).eent_eff_name; }
+       if (flag.capeffect == "")       { flag.capeffect = EFFECT_CAP(teamnumber).eent_eff_name; }
 
        // sounds
        flag.snd_flag_taken = strzone(SND(CTF_TAKEN(teamnumber)));