From 75f32635eb47f324db31c8f257c935018dedbc23 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 10 Jun 2016 23:18:32 +1000 Subject: [PATCH] Remove unnecessary returns --- .../mutators/mutator/bloodloss/bloodloss.qc | 2 -- .../mutator/breakablehook/breakablehook.qc | 4 +--- qcsrc/common/mutators/mutator/buffs/buffs.qc | 20 ++++-------------- .../mutators/mutator/bugrigs/bugrigs.qc | 4 ++-- .../mutators/mutator/campcheck/campcheck.qc | 3 --- .../mutators/mutator/instagib/instagib.qc | 20 ++---------------- .../mutator/invincibleproj/invincibleproj.qc | 1 - .../mutators/mutator/melee_only/melee_only.qc | 2 -- .../common/mutators/mutator/midair/midair.qc | 6 ------ .../mutators/mutator/multijump/multijump.qc | 4 ++-- qcsrc/common/mutators/mutator/nades/nades.qc | 11 +--------- .../mutators/mutator/new_toys/new_toys.qc | 4 ---- qcsrc/common/mutators/mutator/nix/nix.qc | 5 ----- .../mutators/mutator/overkill/overkill.qc | 18 ++++------------ .../mutator/physical_items/physical_items.qc | 6 ++---- .../mutator/random_gravity/random_gravity.qc | 4 ---- .../mutator/rocketflying/rocketflying.qc | 1 - .../mutator/rocketminsta/rocketminsta.qc | 8 ++----- .../mutators/mutator/sandbox/sandbox.qc | 9 +++----- .../spawn_near_teammate.qc | 15 +++++-------- .../mutators/mutator/superspec/superspec.qc | 14 ++++--------- .../mutator/touchexplode/touchexplode.qc | 2 -- .../mutators/mutator/vampire/vampire.qc | 2 -- qcsrc/server/g_damage.qc | 2 -- .../mutators/mutator/gamemode_assault.qc | 7 ------- qcsrc/server/mutators/mutator/gamemode_ca.qc | 13 ++---------- qcsrc/server/mutators/mutator/gamemode_ctf.qc | 18 +--------------- qcsrc/server/mutators/mutator/gamemode_cts.qc | 14 ------------- .../mutators/mutator/gamemode_domination.qc | 3 +-- .../mutators/mutator/gamemode_freezetag.qc | 21 ++++++++----------- .../mutators/mutator/gamemode_invasion.qc | 18 +--------------- .../mutators/mutator/gamemode_keepaway.qc | 7 ------- .../mutators/mutator/gamemode_keyhunt.qc | 6 ------ qcsrc/server/mutators/mutator/gamemode_lms.qc | 7 ------- .../server/mutators/mutator/gamemode_race.qc | 15 ------------- 35 files changed, 46 insertions(+), 250 deletions(-) diff --git a/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc b/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc index 9bb88a2f8..a335bf1cc 100644 --- a/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc +++ b/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc @@ -29,8 +29,6 @@ MUTATOR_HOOKFUNCTION(bloodloss, PlayerJump) if(player.health <= autocvar_g_bloodloss) return true; - - return false; } MUTATOR_HOOKFUNCTION(bloodloss, BuildMutatorsString) diff --git a/qcsrc/common/mutators/mutator/breakablehook/breakablehook.qc b/qcsrc/common/mutators/mutator/breakablehook/breakablehook.qc index e0cf91b35..ca266eb5a 100644 --- a/qcsrc/common/mutators/mutator/breakablehook/breakablehook.qc +++ b/qcsrc/common/mutators/mutator/breakablehook/breakablehook.qc @@ -23,10 +23,8 @@ MUTATOR_HOOKFUNCTION(breakablehook, PlayerDamage_Calculate) { Damage (frag_target.realowner, frag_attacker, frag_attacker, 5, WEP_HOOK.m_id | HITTYPE_SPLASH, frag_target.realowner.origin, '0 0 0'); RemoveGrapplingHook(frag_target.realowner); - return false; // dead + return; // dead } } - - return false; } #endif diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qc b/qcsrc/common/mutators/mutator/buffs/buffs.qc index dbddbfc84..87046b96e 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qc @@ -509,7 +509,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_SplitHealthArmor) float frag_deathtype = M_ARGV(6, float); float frag_damage = M_ARGV(7, float); - if(frag_deathtype == DEATH_BUFF.m_id) { return false; } + if(frag_deathtype == DEATH_BUFF.m_id) { return; } if(frag_target.buffs & BUFF_RESISTANCE.m_itemid) { @@ -517,8 +517,6 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_SplitHealthArmor) M_ARGV(4, float) = v.x; // take M_ARGV(5, float) = v.y; // save } - - return false; } MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_Calculate) @@ -529,7 +527,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_Calculate) float frag_damage = M_ARGV(4, float); vector frag_force = M_ARGV(6, vector); - if(frag_deathtype == DEATH_BUFF.m_id) { return false; } + if(frag_deathtype == DEATH_BUFF.m_id) { return; } if(frag_target.buffs & BUFF_SPEED.m_itemid) if(frag_target != frag_attacker) @@ -620,8 +618,6 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_Calculate) M_ARGV(4, float) = frag_damage; M_ARGV(6, vector) = frag_force; - - return false; } MUTATOR_HOOKFUNCTION(buffs, PlayerSpawn) @@ -632,7 +628,6 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerSpawn) // reset timers here to prevent them continuing after re-spawn player.buff_disability_time = 0; player.buff_disability_effect_time = 0; - return false; } .float stat_sv_maxspeed; @@ -697,7 +692,6 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDies) frag_target.buff_model = world; } } - return false; } MUTATOR_HOOKFUNCTION(buffs, PlayerUseKey, CBC_ORDER_FIRST) @@ -720,7 +714,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerUseKey, CBC_ORDER_FIRST) MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon) { - if(MUTATOR_RETURNVALUE || gameover) { return false; } + if(MUTATOR_RETURNVALUE || gameover) { return; } entity player = M_ARGV(0, entity); if(player.buffs & BUFF_SWAPPER.m_itemid) @@ -785,7 +779,6 @@ MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon) return true; } } - return false; } bool buffs_RemovePlayer(entity player) @@ -817,8 +810,6 @@ MUTATOR_HOOKFUNCTION(buffs, CustomizeWaypoint) if((wp.owner.flags & FL_CLIENT) && (wp.owner.buffs & BUFF_INVISIBLE.m_itemid) && (e == player)) if(DIFF_TEAM(wp.owner, e)) return true; - - return false; } MUTATOR_HOOKFUNCTION(buffs, OnEntityPreSpawn, CBC_ORDER_LAST) @@ -836,7 +827,6 @@ MUTATOR_HOOKFUNCTION(buffs, OnEntityPreSpawn, CBC_ORDER_LAST) return true; } } - return false; } MUTATOR_HOOKFUNCTION(buffs, WeaponRateFactor) @@ -865,7 +855,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink) { entity player = M_ARGV(0, entity); - if(gameover || IS_DEAD(player)) { return false; } + if(gameover || IS_DEAD(player)) { return; } if(time < player.buff_disability_time) if(time >= player.buff_disability_effect_time) @@ -1055,8 +1045,6 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerRegen) if(self.buffs & BUFF_SPEED.m_itemid) regen_mod_regen = autocvar_g_buffs_speed_regen; - - return false; } REPLICATE(cvar_cl_buffs_autoreplace, bool, "cl_buffs_autoreplace"); diff --git a/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc b/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc index df25ad4c5..96490700e 100644 --- a/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc +++ b/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc @@ -273,7 +273,7 @@ MUTATOR_HOOKFUNCTION(bugrigs, PM_Physics) { entity player = M_ARGV(0, entity); - if(!PHYS_BUGRIGS(player) || !IS_PLAYER(player)) { return false; } + if(!PHYS_BUGRIGS(player) || !IS_PLAYER(player)) { return; } #ifdef SVQC player.angles = player.bugrigs_prevangles; @@ -285,7 +285,7 @@ MUTATOR_HOOKFUNCTION(bugrigs, PM_Physics) MUTATOR_HOOKFUNCTION(bugrigs, PlayerPhysics) { - if(!PHYS_BUGRIGS(M_ARGV(0, entity))) { return false; } + if(!PHYS_BUGRIGS(M_ARGV(0, entity))) { return; } #ifdef SVQC entity player = M_ARGV(0, entity); player.bugrigs_prevangles = player.angles; diff --git a/qcsrc/common/mutators/mutator/campcheck/campcheck.qc b/qcsrc/common/mutators/mutator/campcheck/campcheck.qc index 38a1ab835..48b90ae7b 100644 --- a/qcsrc/common/mutators/mutator/campcheck/campcheck.qc +++ b/qcsrc/common/mutators/mutator/campcheck/campcheck.qc @@ -13,7 +13,6 @@ MUTATOR_HOOKFUNCTION(campcheck, PlayerDies) entity frag_target = M_ARGV(2, entity); Kill_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CPID_CAMPCHECK); - return false; } MUTATOR_HOOKFUNCTION(campcheck, PlayerDamage_Calculate) @@ -28,8 +27,6 @@ MUTATOR_HOOKFUNCTION(campcheck, PlayerDamage_Calculate) frag_target.campcheck_traveled_distance = autocvar_g_campcheck_distance; frag_attacker.campcheck_traveled_distance = autocvar_g_campcheck_distance; } - - return false; } MUTATOR_HOOKFUNCTION(campcheck, PlayerPreThink) diff --git a/qcsrc/common/mutators/mutator/instagib/instagib.qc b/qcsrc/common/mutators/mutator/instagib/instagib.qc index 0f1b199a4..89bbf5fae 100644 --- a/qcsrc/common/mutators/mutator/instagib/instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/instagib.qc @@ -140,7 +140,6 @@ void instagib_ammocheck(entity this) MUTATOR_HOOKFUNCTION(mutator_instagib, MatchEnd) { FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(instagib_stop_countdown(it))); - return false; } MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterDropItem) @@ -148,8 +147,6 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterDropItem) entity item = M_ARGV(1, entity); item.monster_loot = spawnfunc_item_minst_cells; - - return false; } MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterSpawn) @@ -159,8 +156,6 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterSpawn) // always refill ammo if(mon.monsterid == MON_MAGE.monsterid) mon.skin = 1; - - return false; } MUTATOR_HOOKFUNCTION(mutator_instagib, BotShouldAttack) @@ -169,8 +164,6 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, BotShouldAttack) if (targ.items & ITEM_Invisibility.m_itemid) return true; - - return false; } MUTATOR_HOOKFUNCTION(mutator_instagib, MakePlayerObserver) @@ -269,7 +262,6 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_SplitHealthArmor) MUTATOR_HOOKFUNCTION(mutator_instagib, ForbidThrowCurrentWeapon) { // weapon dropping on death handled by FilterItem - return true; } @@ -358,8 +350,6 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_Calculate) M_ARGV(4, float) = frag_damage; M_ARGV(5, float) = frag_mirrordamage; M_ARGV(6, vector) = frag_force; - - return false; } MUTATOR_HOOKFUNCTION(mutator_instagib, SetStartItems) @@ -376,8 +366,6 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, SetStartItems) start_weapons = warmup_start_weapons = WEPSET(VAPORIZER); start_items |= IT_UNLIMITED_SUPERWEAPONS; - - return false; } MUTATOR_HOOKFUNCTION(mutator_instagib, FilterItem) @@ -429,8 +417,6 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, CustomizeWaypoint) if((wp.owner.flags & FL_CLIENT) && (wp.owner.items & ITEM_Invisibility.m_itemid) && (e == player)) if(DIFF_TEAM(wp.owner, e)) return true; - - return false; } MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDies) @@ -439,8 +425,6 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDies) if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER)) M_ARGV(4, float) = 1000; // always gib if it was a vaporizer death - - return false; } MUTATOR_HOOKFUNCTION(mutator_instagib, ItemTouch) @@ -477,11 +461,11 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, ItemTouch) MUTATOR_HOOKFUNCTION(mutator_instagib, OnEntityPreSpawn) { - if (!autocvar_g_powerups) { return false; } + if (!autocvar_g_powerups) { return; } entity ent = M_ARGV(0, entity); // Can't use .itemdef here if (!(ent.classname == "item_strength" || ent.classname == "item_invincible" || ent.classname == "item_health_mega")) - return false; + return; entity e = spawn(); diff --git a/qcsrc/common/mutators/mutator/invincibleproj/invincibleproj.qc b/qcsrc/common/mutators/mutator/invincibleproj/invincibleproj.qc index a35a60a9b..5bdafa1f1 100644 --- a/qcsrc/common/mutators/mutator/invincibleproj/invincibleproj.qc +++ b/qcsrc/common/mutators/mutator/invincibleproj/invincibleproj.qc @@ -10,7 +10,6 @@ MUTATOR_HOOKFUNCTION(invincibleprojectiles, EditProjectile) // disable health which in effect disables damage calculations proj.health = 0; } - return false; } MUTATOR_HOOKFUNCTION(invincibleprojectiles, BuildMutatorsString) diff --git a/qcsrc/common/mutators/mutator/melee_only/melee_only.qc b/qcsrc/common/mutators/mutator/melee_only/melee_only.qc index ee5de3dfc..ecd5fc7c8 100644 --- a/qcsrc/common/mutators/mutator/melee_only/melee_only.qc +++ b/qcsrc/common/mutators/mutator/melee_only/melee_only.qc @@ -5,8 +5,6 @@ MUTATOR_HOOKFUNCTION(melee_only, SetStartItems) { start_ammo_shells = warmup_start_ammo_shells = 0; start_weapons = warmup_start_weapons = WEPSET(SHOTGUN); - - return false; } MUTATOR_HOOKFUNCTION(melee_only, ForbidThrowCurrentWeapon) diff --git a/qcsrc/common/mutators/mutator/midair/midair.qc b/qcsrc/common/mutators/mutator/midair/midair.qc index 73792896c..cda6b4c82 100644 --- a/qcsrc/common/mutators/mutator/midair/midair.qc +++ b/qcsrc/common/mutators/mutator/midair/midair.qc @@ -15,8 +15,6 @@ MUTATOR_HOOKFUNCTION(midair, PlayerDamage_Calculate) if(IS_PLAYER(frag_target)) if(time < frag_target.midair_shieldtime) M_ARGV(4, float) = 0; - - return false; } MUTATOR_HOOKFUNCTION(midair, PlayerPowerups) @@ -29,8 +27,6 @@ MUTATOR_HOOKFUNCTION(midair, PlayerPowerups) player.effects |= (EF_ADDITIVE | EF_FULLBRIGHT); player.midair_shieldtime = max(player.midair_shieldtime, time + autocvar_g_midair_shieldtime); } - - return false; } MUTATOR_HOOKFUNCTION(midair, PlayerSpawn) @@ -39,8 +35,6 @@ MUTATOR_HOOKFUNCTION(midair, PlayerSpawn) if(IS_BOT_CLIENT(player)) player.bot_moveskill = 0; // disable bunnyhopping - - return false; } MUTATOR_HOOKFUNCTION(midair, BuildMutatorsString) diff --git a/qcsrc/common/mutators/mutator/multijump/multijump.qc b/qcsrc/common/mutators/mutator/multijump/multijump.qc index cafe5255f..780836d49 100644 --- a/qcsrc/common/mutators/mutator/multijump/multijump.qc +++ b/qcsrc/common/mutators/mutator/multijump/multijump.qc @@ -47,11 +47,11 @@ MUTATOR_HOOKFUNCTION(multijump, PlayerJump) { entity player = M_ARGV(0, entity); - if(!PHYS_MULTIJUMP(player)) { return false; } + if(!PHYS_MULTIJUMP(player)) { return; } int client_multijump = PHYS_MULTIJUMP_CLIENT(player); if(client_multijump > 1) - return false; // nope + return; // nope if (!IS_JUMP_HELD(player) && !IS_ONGROUND(player) && client_multijump) // jump button pressed this frame and we are in midair player.multijump_ready = true; // this is necessary to check that we released the jump button and pressed it again diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 07bac08da..1ad59926e 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -1144,14 +1144,13 @@ MUTATOR_HOOKFUNCTION(nades, ForbidThrowCurrentWeapon, CBC_ORDER_LAST) nades_CheckThrow(player); return true; } - return false; } MUTATOR_HOOKFUNCTION(nades, PlayerPreThink) { entity player = M_ARGV(0, entity); - if (!IS_PLAYER(player)) { return false; } + if (!IS_PLAYER(player)) { return; } if (player.nade && (player.offhand != OFFHAND_NADE || (player.weapons & WEPSET(HOOK)))) OFFHAND_NADE.offhand_think(OFFHAND_NADE, player, player.nade_altbutton); @@ -1264,8 +1263,6 @@ MUTATOR_HOOKFUNCTION(nades, PlayerSpawn) player.nade_spawnloc = world; } } - - return false; } MUTATOR_HOOKFUNCTION(nades, PlayerDies, CBC_ORDER_LAST) @@ -1324,8 +1321,6 @@ MUTATOR_HOOKFUNCTION(nades, PlayerDamage_Calculate) Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_NADE, frag_target.netname); Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF); } - - return false; } MUTATOR_HOOKFUNCTION(nades, MonsterDies) @@ -1337,8 +1332,6 @@ MUTATOR_HOOKFUNCTION(nades, MonsterDies) if(DIFF_TEAM(frag_attacker, frag_target)) if(!(frag_target.spawnflags & MONSTERFLAG_SPAWNED)) nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_minor); - - return false; } MUTATOR_HOOKFUNCTION(nades, DropSpecialItems) @@ -1347,8 +1340,6 @@ MUTATOR_HOOKFUNCTION(nades, DropSpecialItems) if(frag_target.nade) toss_nade(frag_target, true, '0 0 0', time + 0.05); - - return false; } void nades_RemovePlayer(entity this) diff --git a/qcsrc/common/mutators/mutator/new_toys/new_toys.qc b/qcsrc/common/mutators/mutator/new_toys/new_toys.qc index 981657234..a52fc4670 100644 --- a/qcsrc/common/mutators/mutator/new_toys/new_toys.qc +++ b/qcsrc/common/mutators/mutator/new_toys/new_toys.qc @@ -111,7 +111,6 @@ const float NT_AUTOREPLACE_RANDOM = 2; MUTATOR_HOOKFUNCTION(nt, SetModname) { M_ARGV(0, string) = "NewToys"; - return false; } bool nt_IsNewToy(int w) @@ -191,8 +190,6 @@ MUTATOR_HOOKFUNCTION(nt, SetStartItems) warmup_newdefault &= warmup_start_weapons_defaultmask; warmup_start_weapons &= ~warmup_start_weapons_defaultmask; warmup_start_weapons |= warmup_newdefault; - - return 0; } MUTATOR_HOOKFUNCTION(nt, SetWeaponreplace) @@ -227,6 +224,5 @@ MUTATOR_HOOKFUNCTION(nt, FilterItem) item.item_pickupsound = string_null; item.item_pickupsound_ent = SND_WEAPONPICKUP_NEW_TOYS; } - return false; } #endif diff --git a/qcsrc/common/mutators/mutator/nix/nix.qc b/qcsrc/common/mutators/mutator/nix/nix.qc index c94198c80..cfc89b057 100644 --- a/qcsrc/common/mutators/mutator/nix/nix.qc +++ b/qcsrc/common/mutators/mutator/nix/nix.qc @@ -66,8 +66,6 @@ REGISTER_MUTATOR(nix, cvar("g_nix") && !cvar("g_instagib") && !cvar("g_overkill" PS(it).m_switchweapon = w_getbestweapon(it); }); } - - return false; } bool NIX_CanChooseWeapon(int wpn) @@ -260,7 +258,6 @@ MUTATOR_HOOKFUNCTION(nix, OnEntityPreSpawn) if(ent.classname == "target_items") // items triggers cannot work in nix (as they change weapons/ammo) return true; - return false; } MUTATOR_HOOKFUNCTION(nix, PlayerPreThink) @@ -280,12 +277,10 @@ MUTATOR_HOOKFUNCTION(nix, PlayerSpawn) player.nix_lastchange_id = -1; NIX_GiveCurrentWeapon(player); // overrides the weapons you got when spawning player.items |= IT_UNLIMITED_SUPERWEAPONS; - return false; } MUTATOR_HOOKFUNCTION(nix, SetModname, CBC_ORDER_LAST) { M_ARGV(0, string) = "NIX"; - return false; } #endif diff --git a/qcsrc/common/mutators/mutator/overkill/overkill.qc b/qcsrc/common/mutators/mutator/overkill/overkill.qc index d97e375b7..19e88cd63 100644 --- a/qcsrc/common/mutators/mutator/overkill/overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/overkill.qc @@ -35,8 +35,6 @@ REGISTER_MUTATOR(ok, cvar("g_overkill") && !cvar("g_instagib") && !g_nexball && WEP_RPC.spawnflags |= WEP_FLAG_MUTATORBLOCKED; WEP_HMG.spawnflags |= WEP_FLAG_MUTATORBLOCKED; } - - return false; } MUTATOR_HOOKFUNCTION(ok, W_DecreaseAmmo) @@ -87,7 +85,7 @@ float ok_CheckWeaponCharge(entity ent, int wep) entity wepent = Weapons_from(wep); - if(wepent == WEP_Null) return 0; // dummy + if(wepent == WEP_Null) return false; // dummy return (ent.ammo_charge[wep] >= cvar(sprintf("g_overkill_ammo_decharge_%s", wepent.netname))); } @@ -112,8 +110,6 @@ MUTATOR_HOOKFUNCTION(ok, PlayerDamage_Calculate, CBC_ORDER_LAST) M_ARGV(4, float) = 0; } - - return false; } MUTATOR_HOOKFUNCTION(ok, PlayerDamage_SplitHealthArmor) @@ -195,12 +191,12 @@ MUTATOR_HOOKFUNCTION(ok, ForbidThrowCurrentWeapon) MUTATOR_HOOKFUNCTION(ok, PlayerPreThink) { if(intermission_running || gameover) - return false; + return; entity player = M_ARGV(0, entity); if(IS_DEAD(player) || !IS_PLAYER(player) || STAT(FROZEN, player)) - return false; + return; if(player.ok_lastwep) { @@ -283,8 +279,6 @@ MUTATOR_HOOKFUNCTION(ok, PlayerSpawn) player.ok_lastwep = 0; player.ok_pauseregen_finished = time + 2; - - return false; } void self_spawnfunc_weapon_hmg(entity this) { spawnfunc_weapon_hmg(this); } @@ -331,8 +325,6 @@ MUTATOR_HOOKFUNCTION(ok, OnEntityPreSpawn) return true; } } - - return false; } MUTATOR_HOOKFUNCTION(ok, FilterItem) @@ -340,7 +332,7 @@ MUTATOR_HOOKFUNCTION(ok, FilterItem) entity item = M_ARGV(0, entity); if(item.ok_item) - return false; + return; switch(item.items) { @@ -369,8 +361,6 @@ MUTATOR_HOOKFUNCTION(ok, SetStartItems) start_items |= IT_UNLIMITED_WEAPON_AMMO; start_weapons = warmup_start_weapons = ok_start_items; - - return false; } MUTATOR_HOOKFUNCTION(ok, BuildMutatorsString) diff --git a/qcsrc/common/mutators/mutator/physical_items/physical_items.qc b/qcsrc/common/mutators/mutator/physical_items/physical_items.qc index 82d6e6cc8..aad331527 100644 --- a/qcsrc/common/mutators/mutator/physical_items/physical_items.qc +++ b/qcsrc/common/mutators/mutator/physical_items/physical_items.qc @@ -93,9 +93,9 @@ MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn) entity item = M_ARGV(0, entity); if(item.owner == world && autocvar_g_physical_items <= 1) - return false; + return; if (item.spawnflags & 1) // floating item - return false; + return; // The actual item can't be physical and trigger at the same time, so make it invisible and use a second entity for physics. // Ugly hack, but unless SOLID_TRIGGER is gotten to work with MOVETYPE_PHYSICS in the engine it can't be fixed. @@ -137,7 +137,5 @@ MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn) item.movetype = MOVETYPE_FOLLOW; item.aiment = wep; // attach the original weapon item.SendEntity3 = func_null; - - return false; } #endif diff --git a/qcsrc/common/mutators/mutator/random_gravity/random_gravity.qc b/qcsrc/common/mutators/mutator/random_gravity/random_gravity.qc index 22c312637..a384a2b9c 100644 --- a/qcsrc/common/mutators/mutator/random_gravity/random_gravity.qc +++ b/qcsrc/common/mutators/mutator/random_gravity/random_gravity.qc @@ -17,8 +17,6 @@ REGISTER_MUTATOR(random_gravity, cvar("g_random_gravity")) { cvar_settemp("sv_gravity", cvar_string("sv_gravity")); // settemp current gravity so it's restored on match end } - - return false; } float gravity_delay; @@ -38,8 +36,6 @@ MUTATOR_HOOKFUNCTION(random_gravity, SV_StartFrame) gravity_delay = time + autocvar_g_random_gravity_delay; LOG_TRACE("Gravity is now: ", ftos(autocvar_sv_gravity), "\n"); - - return false; } MUTATOR_HOOKFUNCTION(random_gravity, BuildMutatorsString) diff --git a/qcsrc/common/mutators/mutator/rocketflying/rocketflying.qc b/qcsrc/common/mutators/mutator/rocketflying/rocketflying.qc index e45c4fe1e..da7e1c3ec 100644 --- a/qcsrc/common/mutators/mutator/rocketflying/rocketflying.qc +++ b/qcsrc/common/mutators/mutator/rocketflying/rocketflying.qc @@ -10,7 +10,6 @@ MUTATOR_HOOKFUNCTION(rocketflying, EditProjectile) // kill detonate delay of rockets proj.spawnshieldtime = time; } - return 0; } MUTATOR_HOOKFUNCTION(rocketflying, BuildMutatorsString) diff --git a/qcsrc/common/mutators/mutator/rocketminsta/rocketminsta.qc b/qcsrc/common/mutators/mutator/rocketminsta/rocketminsta.qc index ca4356ce1..b0a740391 100644 --- a/qcsrc/common/mutators/mutator/rocketminsta/rocketminsta.qc +++ b/qcsrc/common/mutators/mutator/rocketminsta/rocketminsta.qc @@ -7,7 +7,7 @@ REGISTER_MUTATOR(rm, cvar("g_instagib")); MUTATOR_HOOKFUNCTION(rm, PlayerDamage_Calculate) { // we do it this way, so rm can be toggled during the match - if(!autocvar_g_rm) { return false; } + if(!autocvar_g_rm) { return; } entity frag_attacker = M_ARGV(1, entity); entity frag_target = M_ARGV(2, entity); @@ -24,21 +24,17 @@ MUTATOR_HOOKFUNCTION(rm, PlayerDamage_Calculate) frag_damage = 0; M_ARGV(4, float) = frag_damage; - - return false; } MUTATOR_HOOKFUNCTION(rm, PlayerDies) { // we do it this way, so rm can be toggled during the match - if(!autocvar_g_rm) { return false; } + if(!autocvar_g_rm) { return; } float frag_deathtype = M_ARGV(3, float); if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR) || DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO)) M_ARGV(4, float) = 1000; // always gib if it was a vaporizer death - - return false; } #endif diff --git a/qcsrc/common/mutators/mutator/sandbox/sandbox.qc b/qcsrc/common/mutators/mutator/sandbox/sandbox.qc index e6b857a10..62b3fb0bc 100644 --- a/qcsrc/common/mutators/mutator/sandbox/sandbox.qc +++ b/qcsrc/common/mutators/mutator/sandbox/sandbox.qc @@ -35,8 +35,6 @@ REGISTER_MUTATOR(sandbox, cvar("g_sandbox")) { // nothing to remove } - - return false; } const float MAX_STORAGE_ATTACHMENTS = 16; @@ -452,7 +450,7 @@ void sandbox_Database_Load() MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) { if(MUTATOR_RETURNVALUE) // command was already handled? - return false; + return; entity player = M_ARGV(0, entity); string cmd_name = M_ARGV(1, string); @@ -823,15 +821,14 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) return true; } } - return false; } MUTATOR_HOOKFUNCTION(sandbox, SV_StartFrame) { if(!autocvar_g_sandbox_storage_autosave) - return false; + return; if(time < autosave_time) - return false; + return; autosave_time = time + autocvar_g_sandbox_storage_autosave; sandbox_Database_Save(); diff --git a/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc b/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc index 038548399..c53e9d144 100644 --- a/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc +++ b/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc @@ -23,12 +23,12 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score) vector spawn_score = M_ARGV(2, vector); if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && player.cvar_cl_spawn_near_teammate)) - return false; + return; spawn_spot.msnt_lookat = world; if(!teamplay) - return false; + return; RandomSelection_Init(); FOREACH_CLIENT(IS_PLAYER(it) && it != player && SAME_TEAM(it, player) && !IS_DEAD(it), LAMBDA( @@ -50,13 +50,11 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score) spawn_score.x += SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM; // prefer same team, if we can't find a spawn near teammate M_ARGV(2, vector) = spawn_score; - - return false; } MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn) { - if(!teamplay) { return false; } + if(!teamplay) { return; } entity player = M_ARGV(0, entity); entity spawn_spot = M_ARGV(1, entity); @@ -73,7 +71,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn) }); if(num_red == 1 || num_blue == 1 || num_yellow == 1 || num_pink == 1) - return false; // at least 1 team has only 1 player, let's not give the bigger team too much of an advantage! + return; // at least 1 team has only 1 player, let's not give the bigger team too much of an advantage! // Note: when entering this, fixangle is already set. if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && player.cvar_cl_spawn_near_teammate)) @@ -147,7 +145,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn) player.angles = it.angles; player.angles_z = 0; // never spawn tilted even if the spot says to it.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay; - return false; + return; } } } @@ -177,8 +175,6 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn) sprint(player, "angles: ", vtos(player.angles), "\n"); */ } - - return false; } MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerDies) @@ -186,7 +182,6 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerDies) entity frag_target = M_ARGV(0, entity); frag_target.msnt_deathloc = frag_target.origin; - return false; } REPLICATE(cvar_cl_spawn_near_teammate, bool, "cl_spawn_near_teammate"); diff --git a/qcsrc/common/mutators/mutator/superspec/superspec.qc b/qcsrc/common/mutators/mutator/superspec/superspec.qc index 93f35f13f..786796866 100644 --- a/qcsrc/common/mutators/mutator/superspec/superspec.qc +++ b/qcsrc/common/mutators/mutator/superspec/superspec.qc @@ -154,14 +154,14 @@ MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand) var = strcat(var, text," ^7(^3 ", long, "^7 | ^3", short, " ^7)\n") if(MUTATOR_RETURNVALUE) // command was already handled? - return false; + return; entity player = M_ARGV(0, entity); string cmd_name = M_ARGV(1, string); int cmd_argc = M_ARGV(2, int); if(IS_PLAYER(player)) - return false; + return; if(cmd_name == "superspec_itemfilter") { @@ -365,8 +365,6 @@ MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand) superspec_msg("", "", player, "No active Shield\n", 1); return true; } - - return false; #undef OPTIONINFO } @@ -393,7 +391,7 @@ MUTATOR_HOOKFUNCTION(superspec, ClientConnect) entity player = M_ARGV(0, entity); if(!IS_REAL_CLIENT(player)) - return false; + return; string fn = "superspec-local.options"; float fh; @@ -409,7 +407,7 @@ MUTATOR_HOOKFUNCTION(superspec, ClientConnect) if (!_ISLOCAL(player)) { if(player.crypto_idfp == "") - return false; + return; fn = sprintf("superspec-%s.options", uri_escape(player.crypto_idfp)); } @@ -434,8 +432,6 @@ MUTATOR_HOOKFUNCTION(superspec, ClientConnect) } fclose(fh); } - - return false; } MUTATOR_HOOKFUNCTION(superspec, PlayerDies) @@ -452,8 +448,6 @@ MUTATOR_HOOKFUNCTION(superspec, PlayerDies) superspec_Spectate(it, frag_attacker); } )); - - return false; } MUTATOR_HOOKFUNCTION(superspec, ClientDisconnect) diff --git a/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc b/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc index 1698b3a64..fc3177aa2 100644 --- a/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc +++ b/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc @@ -43,7 +43,5 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink) player.touchexplode_time = it.touchexplode_time = time + 0.2; } )); - - return false; } #endif diff --git a/qcsrc/common/mutators/mutator/vampire/vampire.qc b/qcsrc/common/mutators/mutator/vampire/vampire.qc index 61b0adc45..d245c8059 100644 --- a/qcsrc/common/mutators/mutator/vampire/vampire.qc +++ b/qcsrc/common/mutators/mutator/vampire/vampire.qc @@ -14,8 +14,6 @@ MUTATOR_HOOKFUNCTION(vampire, PlayerDamage_SplitHealthArmor) frag_attacker.health += bound(0, damage_take, frag_target.health); frag_attacker.health = bound(0, frag_attacker.health, autocvar_g_balance_health_limit); } - - return false; } MUTATOR_HOOKFUNCTION(vampire, BuildMutatorsString) diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 7bb41c6d2..beaf7805a 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -103,9 +103,7 @@ void GiveFrags (entity attacker, entity targ, float f, int deathtype) // FIXME fix the mess this is (we have REAL points now!) if(MUTATOR_CALLHOOK(GiveFragsForKill, attacker, targ, f)) - { f = M_ARGV(2, float); - } attacker.totalfrags += f; diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qc b/qcsrc/server/mutators/mutator/gamemode_assault.qc index 9446080bc..7c32b077a 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qc +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qc @@ -615,8 +615,6 @@ MUTATOR_HOOKFUNCTION(as, PlayerSpawn) Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ASSAULT_ATTACKING); else Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ASSAULT_DEFENDING); - - return false; } MUTATOR_HOOKFUNCTION(as, TurretSpawn) @@ -625,8 +623,6 @@ MUTATOR_HOOKFUNCTION(as, TurretSpawn) if(!turret.team || turret.team == MAX_SHOT_DISTANCE) turret.team = 5; // this gets reversed when match starts? - - return false; } MUTATOR_HOOKFUNCTION(as, VehicleSpawn) @@ -668,7 +664,6 @@ MUTATOR_HOOKFUNCTION(as, ReadLevelCvars) { // no assault warmups warmup_stage = 0; - return false; } MUTATOR_HOOKFUNCTION(as, OnEntityPreSpawn) @@ -683,8 +678,6 @@ MUTATOR_HOOKFUNCTION(as, OnEntityPreSpawn) case "info_player_team4": return true; } - - return false; } // scoreboard setup diff --git a/qcsrc/server/mutators/mutator/gamemode_ca.qc b/qcsrc/server/mutators/mutator/gamemode_ca.qc index 943fd27d7..fe31e37cc 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ca.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ca.qc @@ -313,7 +313,7 @@ MUTATOR_HOOKFUNCTION(ca, PlayerDies) frag_target.respawn_flags = RESPAWN_SILENT; if (!warmup_stage) eliminatedPlayers.SendFlags |= 1; - return 1; + return true; } MUTATOR_HOOKFUNCTION(ca, ClientDisconnect) @@ -327,7 +327,7 @@ MUTATOR_HOOKFUNCTION(ca, ClientDisconnect) MUTATOR_HOOKFUNCTION(ca, ForbidPlayerScore_Clear) { - return 1; + return true; } MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver) @@ -367,8 +367,6 @@ MUTATOR_HOOKFUNCTION(ca, SetStartItems) start_ammo_cells = warmup_start_ammo_cells = cvar("g_lms_start_ammo_cells"); start_ammo_plasma = warmup_start_ammo_plasma = cvar("g_lms_start_ammo_plasma"); start_ammo_fuel = warmup_start_ammo_fuel = cvar("g_lms_start_ammo_fuel"); - - return 0; } MUTATOR_HOOKFUNCTION(ca, PlayerDamage_Calculate) @@ -388,8 +386,6 @@ MUTATOR_HOOKFUNCTION(ca, PlayerDamage_Calculate) M_ARGV(4, float) = frag_damage; M_ARGV(5, float) = frag_mirrordamage; - - return false; } MUTATOR_HOOKFUNCTION(ca, FilterItem) @@ -402,8 +398,6 @@ MUTATOR_HOOKFUNCTION(ca, FilterItem) if (autocvar_g_pickup_items <= 0) return true; - - return false; } MUTATOR_HOOKFUNCTION(ca, PlayerDamage_SplitHealthArmor) @@ -440,8 +434,6 @@ MUTATOR_HOOKFUNCTION(ca, SpectateSet) if (!autocvar_g_ca_spectate_enemies && client.caplayer) if (DIFF_TEAM(targ, client)) return true; - - return false; } MUTATOR_HOOKFUNCTION(ca, SpectateNext) @@ -454,7 +446,6 @@ MUTATOR_HOOKFUNCTION(ca, SpectateNext) targ = CA_SpectateNext(client, targ); return true; } - return false; } MUTATOR_HOOKFUNCTION(ca, SpectatePrev) diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index a2e90dda3..fe63fa7e4 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -2059,7 +2059,6 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerDamage_Calculate) // for changing damage and for } // todo: add notification for when flag carrier needs help? } - return false; } MUTATOR_HOOKFUNCTION(ctf, PlayerDies) @@ -2079,8 +2078,6 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerDies) ctf_Handle_Throw(frag_target, world, DROP_NORMAL); tmp_entity.ctf_dropper = world; } - - return false; } MUTATOR_HOOKFUNCTION(ctf, GiveFragsForKill) @@ -2107,7 +2104,6 @@ MUTATOR_HOOKFUNCTION(ctf, MakePlayerObserver) entity player = M_ARGV(0, entity); ctf_RemovePlayer(player); - return false; } MUTATOR_HOOKFUNCTION(ctf, ClientDisconnect) @@ -2128,7 +2124,7 @@ MUTATOR_HOOKFUNCTION(ctf, PortalTeleport) MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey) { - if(MUTATOR_RETURNVALUE || gameover) { return false; } + if(MUTATOR_RETURNVALUE || gameover) { return; } entity player = M_ARGV(0, entity); @@ -2257,8 +2253,6 @@ MUTATOR_HOOKFUNCTION(ctf, VehicleEnter) } return true; } - - return false; } MUTATOR_HOOKFUNCTION(ctf, VehicleExit) @@ -2274,8 +2268,6 @@ MUTATOR_HOOKFUNCTION(ctf, VehicleExit) player.flagcarried.nodrawtoclient = world; return true; } - - return false; } MUTATOR_HOOKFUNCTION(ctf, AbortSpeedrun) @@ -2288,8 +2280,6 @@ MUTATOR_HOOKFUNCTION(ctf, AbortSpeedrun) ctf_RespawnFlag(player.flagcarried); return true; } - - return false; } MUTATOR_HOOKFUNCTION(ctf, MatchEnd) @@ -2322,8 +2312,6 @@ MUTATOR_HOOKFUNCTION(ctf, MatchEnd) } } } - - return false; } MUTATOR_HOOKFUNCTION(ctf, HavocBot_ChooseRole) @@ -2415,8 +2403,6 @@ MUTATOR_HOOKFUNCTION(ctf, SV_ParseClientCommand) superspec_msg("", "", player, "No active flag carrier\n", 1); return true; } - - return false; } MUTATOR_HOOKFUNCTION(ctf, DropSpecialItems) @@ -2425,8 +2411,6 @@ MUTATOR_HOOKFUNCTION(ctf, DropSpecialItems) if(frag_target.flagcarried) ctf_Handle_Throw(frag_target, world, DROP_THROW); - - return false; } diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc index f72d932c1..a308925fb 100644 --- a/qcsrc/server/mutators/mutator/gamemode_cts.qc +++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc @@ -208,8 +208,6 @@ MUTATOR_HOOKFUNCTION(cts, reset_map_global) cvar_set("timelimit", ftos(race_timelimit)); cts_ScoreRules(); } - - return false; } MUTATOR_HOOKFUNCTION(cts, ClientConnect) @@ -237,8 +235,6 @@ MUTATOR_HOOKFUNCTION(cts, ClientConnect) race_SendRankings(i, 0, 0, MSG_ONE); } } - - return false; } MUTATOR_HOOKFUNCTION(cts, MakePlayerObserver) @@ -252,8 +248,6 @@ MUTATOR_HOOKFUNCTION(cts, MakePlayerObserver) race_PreparePlayer(player); player.race_checkpoint = -1; - - return false; } MUTATOR_HOOKFUNCTION(cts, PlayerSpawn) @@ -270,8 +264,6 @@ MUTATOR_HOOKFUNCTION(cts, PlayerSpawn) player.race_respawn_spotref = spawn_spot; player.race_place = 0; - - return false; } MUTATOR_HOOKFUNCTION(cts, PutClientInServer) @@ -288,7 +280,6 @@ MUTATOR_HOOKFUNCTION(cts, PutClientInServer) race_AbandonRaceCheck(player); } - return false; } MUTATOR_HOOKFUNCTION(cts, PlayerDies) @@ -297,7 +288,6 @@ MUTATOR_HOOKFUNCTION(cts, PlayerDies) frag_target.respawn_flags |= RESPAWN_FORCE; race_AbandonRaceCheck(frag_target); - return false; } MUTATOR_HOOKFUNCTION(cts, HavocBot_ChooseRole) @@ -363,8 +353,6 @@ MUTATOR_HOOKFUNCTION(cts, FilterItem) if(item.classname == "droppedweapon") return true; - - return false; } MUTATOR_HOOKFUNCTION(cts, PlayerDamage_Calculate) @@ -380,8 +368,6 @@ MUTATOR_HOOKFUNCTION(cts, PlayerDamage_Calculate) frag_damage = 0; M_ARGV(4, float) = frag_damage; } - - return false; } MUTATOR_HOOKFUNCTION(cts, ForbidPlayerScore_Clear) diff --git a/qcsrc/server/mutators/mutator/gamemode_domination.qc b/qcsrc/server/mutators/mutator/gamemode_domination.qc index 01c5e4bd8..5f17bf6a1 100644 --- a/qcsrc/server/mutators/mutator/gamemode_domination.qc +++ b/qcsrc/server/mutators/mutator/gamemode_domination.qc @@ -501,7 +501,7 @@ MUTATOR_HOOKFUNCTION(dom, reset_map_players) if(IS_REAL_CLIENT(it)) set_dom_state(it); )); - return 1; + return true; } MUTATOR_HOOKFUNCTION(dom, PlayerSpawn) @@ -513,7 +513,6 @@ MUTATOR_HOOKFUNCTION(dom, PlayerSpawn) player.player_blocked = 1; else player.player_blocked = 0; - return false; } MUTATOR_HOOKFUNCTION(dom, ClientConnect) diff --git a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc index e58dbd8b7..12e4df68a 100644 --- a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc @@ -374,7 +374,6 @@ MUTATOR_HOOKFUNCTION(ft, MakePlayerObserver) entity player = M_ARGV(0, entity); ft_RemovePlayer(player); - return false; } MUTATOR_HOOKFUNCTION(ft, PlayerDies) @@ -389,7 +388,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies) if(STAT(FROZEN, frag_target)) freezetag_Unfreeze(frag_target); freezetag_count_alive_players(); - return 1; // let the player die so that he can respawn whenever he wants + return true; // let the player die so that he can respawn whenever he wants } // Cases DEATH_TEAMCHANGE and DEATH_AUTOTEAMCHANGE are needed to fix a bug whe @@ -408,11 +407,11 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies) freezetag_Unfreeze(frag_target); // remove ice frag_target.health = 0; // Unfreeze resets health frag_target.freezetag_frozen_timeout = -2; // freeze on respawn - return 1; + return true; } if(STAT(FROZEN, frag_target)) - return 1; + return true; freezetag_Freeze(frag_target, frag_attacker); freezetag_LastPlayerForTeam_Notify(frag_target); @@ -432,7 +431,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies) Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_FREEZE, frag_target.netname, frag_attacker.netname); } - return 1; + return true; } MUTATOR_HOOKFUNCTION(ft, PlayerSpawn) @@ -440,12 +439,12 @@ MUTATOR_HOOKFUNCTION(ft, PlayerSpawn) entity player = M_ARGV(0, entity); if(player.freezetag_frozen_timeout == -1) // if PlayerSpawn is called by reset_map_players - return 1; // do nothing, round is starting right now + return true; // do nothing, round is starting right now if(player.freezetag_frozen_timeout == -2) // player was dead { freezetag_Freeze(player, world); - return 1; + return true; } freezetag_count_alive_players(); @@ -457,7 +456,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerSpawn) freezetag_Freeze(player, world); } - return 1; + return true; } MUTATOR_HOOKFUNCTION(ft, reset_map_players) @@ -469,13 +468,13 @@ MUTATOR_HOOKFUNCTION(ft, reset_map_players) it.freezetag_frozen_timeout = 0; )); freezetag_count_alive_players(); - return 1; + return true; } MUTATOR_HOOKFUNCTION(ft, GiveFragsForKill, CBC_ORDER_FIRST) { M_ARGV(2, float) = 0; // no frags counted in Freeze Tag - return 1; + return true; } MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) @@ -583,8 +582,6 @@ MUTATOR_HOOKFUNCTION(ft, SetStartItems) start_ammo_cells = warmup_start_ammo_cells = cvar("g_lms_start_ammo_cells"); start_ammo_plasma = warmup_start_ammo_plasma = cvar("g_lms_start_ammo_plasma"); start_ammo_fuel = warmup_start_ammo_fuel = cvar("g_lms_start_ammo_fuel"); - - return 0; } MUTATOR_HOOKFUNCTION(ft, HavocBot_ChooseRole) diff --git a/qcsrc/server/mutators/mutator/gamemode_invasion.qc b/qcsrc/server/mutators/mutator/gamemode_invasion.qc index 2e04b14dd..c7cd48e8e 100644 --- a/qcsrc/server/mutators/mutator/gamemode_invasion.qc +++ b/qcsrc/server/mutators/mutator/gamemode_invasion.qc @@ -350,8 +350,6 @@ MUTATOR_HOOKFUNCTION(inv, MonsterDies) TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1); } } - - return false; } MUTATOR_HOOKFUNCTION(inv, MonsterSpawn) @@ -373,8 +371,6 @@ MUTATOR_HOOKFUNCTION(inv, MonsterSpawn) Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.monster_name); mon.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP; - - return false; } MUTATOR_HOOKFUNCTION(inv, OnEntityPreSpawn) @@ -384,16 +380,12 @@ MUTATOR_HOOKFUNCTION(inv, OnEntityPreSpawn) if(startsWith(ent.classname, "monster_")) if(!(ent.spawnflags & MONSTERFLAG_SPAWNED)) return true; - - return false; } MUTATOR_HOOKFUNCTION(inv, SV_StartFrame) { monsters_total = inv_maxspawned; // TODO: make sure numspawned never exceeds maxspawned monsters_killed = inv_numkilled; - - return false; } MUTATOR_HOOKFUNCTION(inv, PlayerRegen) @@ -407,7 +399,6 @@ MUTATOR_HOOKFUNCTION(inv, PlayerSpawn) entity player = M_ARGV(0, entity); player.bot_attack = false; - return false; } MUTATOR_HOOKFUNCTION(inv, PlayerDamage_Calculate) @@ -425,14 +416,12 @@ MUTATOR_HOOKFUNCTION(inv, PlayerDamage_Calculate) M_ARGV(4, float) = frag_damage; M_ARGV(6, vector) = frag_force; } - - return false; } MUTATOR_HOOKFUNCTION(inv, SV_ParseClientCommand) { if(MUTATOR_RETURNVALUE) // command was already handled? - return false; + return; entity player = M_ARGV(0, entity); string cmd_name = M_ARGV(1, string); @@ -449,8 +438,6 @@ MUTATOR_HOOKFUNCTION(inv, SV_ParseClientCommand) return true; } - - return false; } MUTATOR_HOOKFUNCTION(inv, BotShouldAttack) @@ -459,15 +446,12 @@ MUTATOR_HOOKFUNCTION(inv, BotShouldAttack) if(!IS_MONSTER(targ)) return true; - - return false; } MUTATOR_HOOKFUNCTION(inv, SetStartItems) { start_health = 200; start_armorvalue = 200; - return false; } MUTATOR_HOOKFUNCTION(inv, AccuracyTargetValid) diff --git a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc index 53d770611..3a6a77df5 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc @@ -335,7 +335,6 @@ MUTATOR_HOOKFUNCTION(ka, PlayerDies) } if(frag_target.ballcarried) { ka_DropEvent(frag_target); } // a player with the ball has died, drop it - return false; } MUTATOR_HOOKFUNCTION(ka, GiveFragsForKill) @@ -404,8 +403,6 @@ MUTATOR_HOOKFUNCTION(ka, PlayerDamage_Calculate) // for changing damage and forc M_ARGV(4, float) = frag_damage; M_ARGV(6, vector) = frag_force; - - return false; } MUTATOR_HOOKFUNCTION(ka, ClientDisconnect) @@ -420,7 +417,6 @@ MUTATOR_HOOKFUNCTION(ka, MakePlayerObserver) entity player = M_ARGV(0, entity); if(player.ballcarried) { ka_DropEvent(player); } // a player with the ball has left the match, drop it - return false; } MUTATOR_HOOKFUNCTION(ka, PlayerPowerups) @@ -458,7 +454,6 @@ MUTATOR_HOOKFUNCTION(ka, BotShouldAttack) // if neither player has ball then don't attack unless the ball is on the ground if(!targ.ballcarried && !bot.ballcarried && ka_ball.owner) return true; - return false; } MUTATOR_HOOKFUNCTION(ka, HavocBot_ChooseRole) @@ -478,8 +473,6 @@ MUTATOR_HOOKFUNCTION(ka, DropSpecialItems) if(frag_target.ballcarried) ka_DropEvent(frag_target); - - return false; } diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 5f4c2e76d..30653641f 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -1314,7 +1314,6 @@ MUTATOR_HOOKFUNCTION(kh, PlayerDies) kh_Key_DropAll(frag_target, false); else kh_Key_DropAll(frag_target, true); - return 0; } MUTATOR_HOOKFUNCTION(kh, GiveFragsForKill, CBC_ORDER_FIRST) @@ -1323,13 +1322,11 @@ MUTATOR_HOOKFUNCTION(kh, GiveFragsForKill, CBC_ORDER_FIRST) entity frag_target = M_ARGV(1, entity); float frag_score = M_ARGV(2, float); M_ARGV(2, float) = kh_HandleFrags(frag_attacker, frag_target, frag_score); - return false; } MUTATOR_HOOKFUNCTION(kh, MatchEnd) { kh_finalize(); - return 0; } MUTATOR_HOOKFUNCTION(kh, GetTeamCount, CBC_ORDER_EXCLUSIVE) @@ -1358,7 +1355,6 @@ MUTATOR_HOOKFUNCTION(kh, PlayerUseKey) return true; } } - return false; } MUTATOR_HOOKFUNCTION(kh, HavocBot_ChooseRole) @@ -1384,13 +1380,11 @@ MUTATOR_HOOKFUNCTION(kh, DropSpecialItems) entity frag_target = M_ARGV(0, entity); kh_Key_DropAll(frag_target, false); - return false; } MUTATOR_HOOKFUNCTION(kh, reset_map_global) { kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round + (game_starttime - time), kh_StartRound); - return false; } #endif diff --git a/qcsrc/server/mutators/mutator/gamemode_lms.qc b/qcsrc/server/mutators/mutator/gamemode_lms.qc index d0ef8e1d4..557b48a90 100644 --- a/qcsrc/server/mutators/mutator/gamemode_lms.qc +++ b/qcsrc/server/mutators/mutator/gamemode_lms.qc @@ -156,15 +156,12 @@ MUTATOR_HOOKFUNCTION(lms, reset_map_global) { lms_lowest_lives = 999; lms_next_place = player_count; - - return false; } MUTATOR_HOOKFUNCTION(lms, reset_map_players) { if(restart_mapalreadyrestarted || (time < game_starttime)) FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(PlayerScore_Add(it, SP_LMS_LIVES, LMS_NewPlayerLives()))); - return false; } MUTATOR_HOOKFUNCTION(lms, PutClientInServer) @@ -185,7 +182,6 @@ MUTATOR_HOOKFUNCTION(lms, PlayerDies) entity frag_target = M_ARGV(2, entity); frag_target.respawn_flags |= RESPAWN_FORCE; - return false; } void lms_RemovePlayer(entity player) @@ -287,8 +283,6 @@ MUTATOR_HOOKFUNCTION(lms, SetStartItems) start_ammo_cells = warmup_start_ammo_cells = cvar("g_lms_start_ammo_cells"); start_ammo_plasma = warmup_start_ammo_plasma = cvar("g_lms_start_ammo_plasma"); start_ammo_fuel = warmup_start_ammo_fuel = cvar("g_lms_start_ammo_fuel"); - - return false; } MUTATOR_HOOKFUNCTION(lms, ForbidPlayerScore_Clear) @@ -400,7 +394,6 @@ MUTATOR_HOOKFUNCTION(lms, AddPlayerScore) if(gameover) if(M_ARGV(0, int) == SP_LMS_RANK) // score field return true; // allow writing to this field in intermission as it is needed for newly joining players - return false; } // scoreboard stuff diff --git a/qcsrc/server/mutators/mutator/gamemode_race.qc b/qcsrc/server/mutators/mutator/gamemode_race.qc index f58004f7b..d1fa685f7 100644 --- a/qcsrc/server/mutators/mutator/gamemode_race.qc +++ b/qcsrc/server/mutators/mutator/gamemode_race.qc @@ -240,8 +240,6 @@ MUTATOR_HOOKFUNCTION(rc, reset_map_global) cvar_set("timelimit", ftos(race_timelimit)); race_ScoreRules(); } - - return false; } MUTATOR_HOOKFUNCTION(rc, ClientConnect) @@ -269,8 +267,6 @@ MUTATOR_HOOKFUNCTION(rc, ClientConnect) race_SendRankings(i, 0, 0, MSG_ONE); } } - - return false; } MUTATOR_HOOKFUNCTION(rc, MakePlayerObserver) @@ -301,8 +297,6 @@ MUTATOR_HOOKFUNCTION(rc, PlayerSpawn) player.race_respawn_spotref = spawn_spot; player.race_place = 0; - - return false; } MUTATOR_HOOKFUNCTION(rc, PutClientInServer) @@ -319,7 +313,6 @@ MUTATOR_HOOKFUNCTION(rc, PutClientInServer) race_AbandonRaceCheck(player); } - return false; } MUTATOR_HOOKFUNCTION(rc, PlayerDies) @@ -328,7 +321,6 @@ MUTATOR_HOOKFUNCTION(rc, PlayerDies) frag_target.respawn_flags |= RESPAWN_FORCE; race_AbandonRaceCheck(frag_target); - return false; } MUTATOR_HOOKFUNCTION(rc, HavocBot_ChooseRole) @@ -386,8 +378,6 @@ MUTATOR_HOOKFUNCTION(rc, ForbidPlayerScore_Clear) { if(g_race_qualifying) return true; // in qualifying, you don't lose score by observing - - return false; } MUTATOR_HOOKFUNCTION(rc, GetTeamCount, CBC_ORDER_EXCLUSIVE) @@ -400,8 +390,6 @@ MUTATOR_HOOKFUNCTION(rc, Scores_CountFragsRemaining) // announce remaining frags if not in qualifying mode if(!g_race_qualifying) return true; - - return false; } MUTATOR_HOOKFUNCTION(rc, GetRecords) @@ -451,15 +439,12 @@ MUTATOR_HOOKFUNCTION(rc, CheckRules_World) return true; } } - - return false; } MUTATOR_HOOKFUNCTION(rc, ReadLevelCvars) { if(g_race_qualifying == 2) warmup_stage = 0; - return false; } void race_Initialize() -- 2.39.2