From: TimePath Date: Tue, 3 Nov 2015 11:50:32 +0000 (+1100) Subject: Effects: fix arc with mismatching effectinfo X-Git-Tag: xonotic-v0.8.2~1735 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=070e6634331ba27017b1a2d36e9b910ad02fb861;p=xonotic%2Fxonotic-data.pk3dir.git Effects: fix arc with mismatching effectinfo --- diff --git a/qcsrc/common/effects/all.inc b/qcsrc/common/effects/all.inc index 052f753d6..72d4565e4 100644 --- a/qcsrc/common/effects/all.inc +++ b/qcsrc/common/effects/all.inc @@ -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") diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index a9fc3fdb6..6b7330e58 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -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 || diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 61c021384..5e05a8e64 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -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)));