From 306cb828fe0b84a64466b826dd304c39c32b49e0 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 19 Oct 2020 07:28:58 +1000 Subject: [PATCH] Port some minor cleanups from the guide branch --- qcsrc/common/mapinfo.qc | 6 ++---- qcsrc/common/mapinfo.qh | 2 +- qcsrc/common/mutators/mutator/nades/nades.inc | 20 +++++++++++++++++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 1b3fa8faf..3ef0b74b7 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -253,11 +253,9 @@ string unquote(string s) return ""; } -float MapInfo_Get_ByID(float i) +bool MapInfo_Get_ByID(int i) { - if(MapInfo_Get_ByName(MapInfo_BSPName_ByID(i), 0, NULL)) - return 1; - return 0; + return MapInfo_Get_ByName(MapInfo_BSPName_ByID(i), 0, NULL) ? true : false; } string _MapInfo_Map_worldspawn_music; diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index c9d6c5e72..2d350b2fe 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -151,7 +151,7 @@ int MapInfo_ForbiddenFlags(); // retrieves current flags from cvars int MapInfo_RequiredFlags(); // retrieves current flags from cvars // load info about the i-th map into the MapInfo_Map_* globals -float MapInfo_Get_ByID(float i); // 1 on success, 0 on failure +bool MapInfo_Get_ByID(int i); // 1 on success, 0 on failure string MapInfo_BSPName_ByID(float i); // load info about a map by name into the MapInfo_Map_* globals diff --git a/qcsrc/common/mutators/mutator/nades/nades.inc b/qcsrc/common/mutators/mutator/nades/nades.inc index 4591d25bf..3270e719f 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.inc +++ b/qcsrc/common/mutators/mutator/nades/nades.inc @@ -3,70 +3,84 @@ this.m_projectile[i] = projectile; \ this.m_trail[i] = trail; \ MACRO_END -#else -#define NADE_PROJECTILE(i, projectile, trail) #endif REGISTER_NADE(NORMAL) { this.m_color = '1 1 1'; +#ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE, EFFECT_Null); NADE_PROJECTILE(1, PROJECTILE_NADE_BURN, EFFECT_Null); +#endif } REGISTER_NADE(NAPALM) { this.m_color = '2 0.5 0'; this.m_name = _("Napalm grenade"); this.m_icon = "nade_napalm"; +#ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_NAPALM, EFFECT_TR_ROCKET); NADE_PROJECTILE(1, PROJECTILE_NADE_NAPALM_BURN, EFFECT_SPIDERBOT_ROCKET_TRAIL); +#endif } REGISTER_NADE(ICE) { this.m_color = '0 0.5 2'; this.m_name = _("Ice grenade"); this.m_icon = "nade_ice"; +#ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_ICE, EFFECT_TR_NEXUIZPLASMA); NADE_PROJECTILE(1, PROJECTILE_NADE_ICE_BURN, EFFECT_RACER_ROCKET_TRAIL); +#endif } REGISTER_NADE(TRANSLOCATE) { this.m_color = '1 0 1'; this.m_name = _("Translocate grenade"); this.m_icon = "nade_translocate"; +#ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_TRANSLOCATE, EFFECT_TR_CRYLINKPLASMA); NADE_PROJECTILE(1, PROJECTILE_NADE_TRANSLOCATE, EFFECT_TR_CRYLINKPLASMA); +#endif } REGISTER_NADE(SPAWN) { this.m_color = '1 0.9 0'; this.m_name = _("Spawn grenade"); this.m_icon = "nade_spawn"; +#ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_SPAWN, EFFECT_NADE_TRAIL_YELLOW); NADE_PROJECTILE(1, PROJECTILE_NADE_SPAWN, EFFECT_NADE_TRAIL_YELLOW); +#endif } REGISTER_NADE(HEAL) { this.m_color = '1 0 0'; this.m_name = _("Heal grenade"); this.m_icon = "nade_heal"; +#ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_HEAL, EFFECT_NADE_TRAIL_RED); NADE_PROJECTILE(1, PROJECTILE_NADE_HEAL_BURN, EFFECT_NADE_TRAIL_BURN_RED); +#endif } REGISTER_NADE(MONSTER) { this.m_color = '0.25 0.75 0'; this.m_name = _("Monster grenade"); this.m_icon = "nade_monster"; +#ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_MONSTER, EFFECT_NADE_TRAIL_RED); NADE_PROJECTILE(1, PROJECTILE_NADE_MONSTER_BURN, EFFECT_NADE_TRAIL_BURN_RED); +#endif } REGISTER_NADE(ENTRAP) { this.m_color = '0.15 0.85 0'; this.m_name = _("Entrap grenade"); this.m_icon = "nade_entrap"; +#ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_ENTRAP, EFFECT_NADE_TRAIL_YELLOW); NADE_PROJECTILE(1, PROJECTILE_NADE_ENTRAP_BURN, EFFECT_NADE_TRAIL_BURN_YELLOW); +#endif } REGISTER_NADE(VEIL) { @@ -74,6 +88,8 @@ REGISTER_NADE(VEIL) { this.m_name = _("Veil grenade"); this.m_icon = "nade_veil"; this.m_alpha = 0.45; +#ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_VEIL, EFFECT_NADE_TRAIL_NEUTRAL); NADE_PROJECTILE(1, PROJECTILE_NADE_VEIL_BURN, EFFECT_NADE_TRAIL_BURN_NEUTRAL); +#endif } -- 2.39.2