From: LegendaryGuard Date: Mon, 10 Jul 2023 14:49:42 +0000 (+0200) Subject: Refactor registered NADE_TYPE_DARK into NADE_TYPE_DARKNESS and correct some indentations X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=336971f00fda054f5677e18e17e88cd10fe3c85b;p=xonotic%2Fxonotic-data.pk3dir.git Refactor registered NADE_TYPE_DARK into NADE_TYPE_DARKNESS and correct some indentations --- diff --git a/qcsrc/common/mutators/mutator/nades/nades.inc b/qcsrc/common/mutators/mutator/nades/nades.inc index ab798e3cd..b1d1d7c1e 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.inc +++ b/qcsrc/common/mutators/mutator/nades/nades.inc @@ -104,7 +104,7 @@ REGISTER_NADE(AMMO) { #endif } -REGISTER_NADE(DARK) { +REGISTER_NADE(DARKNESS) { this.m_color = '0.23 0 0.23'; this.m_name = _("Darkness grenade"); this.m_icon = "nade_darkness"; diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 272da5677..c0d7b2991 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -51,7 +51,7 @@ bool darkblink; void HUD_DarkBlinking() { vector bottomright = vec2(vid_conwidth, vid_conheight); - drawfill('0 0 0', bottomright, NADE_TYPE_DARK.m_color, 0.986, DRAWFLAG_NORMAL); + drawfill('0 0 0', bottomright, NADE_TYPE_DARNESS.m_color, 0.986, DRAWFLAG_NORMAL); } REGISTER_MUTATOR(cl_nades, true); @@ -59,7 +59,7 @@ MUTATOR_HOOKFUNCTION(cl_nades, HUD_Draw_overlay) { if (STAT(NADE_DARKNESS_TIME) > time) { - M_ARGV(0, vector) = NADE_TYPE_DARK.m_color; + M_ARGV(0, vector) = NADE_TYPE_DARNESS.m_color; HUD_DarkBlinking(); return true; } @@ -951,7 +951,7 @@ void nade_boom(entity this) SET_NADE_EFFECT(NADE_TYPE_ENTRAP, false, EFFECT_SPAWN_YELLOW); SET_NADE_EFFECT(NADE_TYPE_VEIL, false, EFFECT_SPAWN_NEUTRAL); SET_NADE_EFFECT(NADE_TYPE_AMMO, false, EFFECT_SPAWN_BROWN); - SET_NADE_EFFECT(NADE_TYPE_DARK, false, EFFECT_EXPLOSION_MEDIUM); + SET_NADE_EFFECT(NADE_TYPE_DARNESS, false, EFFECT_EXPLOSION_MEDIUM); SET_NADE_EFFECT(NADE_TYPE_NORMAL, true, EFFECT_NADE_EXPLODE(this.realowner.team)); default: expef = EFFECT_NADE_EXPLODE(this.realowner.team); break; } @@ -972,16 +972,16 @@ void nade_boom(entity this) if(this.takedamage) switch ( REGISTRY_GET(Nades, STAT(NADE_BONUS_TYPE, this)) ) { - case NADE_TYPE_NAPALM: nade_napalm_boom(this); break; - case NADE_TYPE_ICE: nade_ice_boom(this); break; - case NADE_TYPE_TRANSLOCATE: nade_translocate_boom(this); break; - case NADE_TYPE_SPAWN: nade_spawn_boom(this); break; - case NADE_TYPE_HEAL: nade_heal_boom(this); break; - case NADE_TYPE_MONSTER: nade_monster_boom(this); break; - case NADE_TYPE_ENTRAP: nade_entrap_boom(this); break; - case NADE_TYPE_VEIL: nade_veil_boom(this); break; - case NADE_TYPE_AMMO: nade_ammo_boom(this); break; - case NADE_TYPE_DARK: nade_darkness_boom(this); break; + case NADE_TYPE_NAPALM: nade_napalm_boom(this); break; + case NADE_TYPE_ICE: nade_ice_boom(this); break; + case NADE_TYPE_TRANSLOCATE: nade_translocate_boom(this); break; + case NADE_TYPE_SPAWN: nade_spawn_boom(this); break; + case NADE_TYPE_HEAL: nade_heal_boom(this); break; + case NADE_TYPE_MONSTER: nade_monster_boom(this); break; + case NADE_TYPE_ENTRAP: nade_entrap_boom(this); break; + case NADE_TYPE_VEIL: nade_veil_boom(this); break; + case NADE_TYPE_AMMO: nade_ammo_boom(this); break; + case NADE_TYPE_DARNESS: nade_darkness_boom(this); break; } IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this, @@ -1440,7 +1440,7 @@ int nades_CheckTypes(entity player, int cl_ntype) CL_NADE_TYPE_CHECK(NADE_TYPE_ENTRAP, autocvar_g_nades_entrap); CL_NADE_TYPE_CHECK(NADE_TYPE_VEIL, autocvar_g_nades_veil); CL_NADE_TYPE_CHECK(NADE_TYPE_AMMO, autocvar_g_nades_ammo); - CL_NADE_TYPE_CHECK(NADE_TYPE_DARK, autocvar_g_nades_darkness); + CL_NADE_TYPE_CHECK(NADE_TYPE_DARNESS, autocvar_g_nades_darkness); } return cl_ntype; #undef CL_NADE_TYPE_CHECK