From: Mario Date: Mon, 19 Oct 2020 01:38:22 +0000 (+1000) Subject: If item touching or spawning is already handled, don't attempt to spawn another life... X-Git-Tag: xonotic-v0.8.5~721 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0b23bc0a9bb4d54629387b32ac8621c1338b489a;p=xonotic%2Fxonotic-data.pk3dir.git If item touching or spawning is already handled, don't attempt to spawn another life powerup in LMS and instagib, fixes #2336 --- diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index 1b7b527d8..ba45f6e7e 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -355,6 +355,7 @@ void lms_extralife(entity this) MUTATOR_HOOKFUNCTION(lms, OnEntityPreSpawn) { + if (MUTATOR_RETURNVALUE) return false; if (!autocvar_g_powerups) return false; if (!autocvar_g_lms_extra_lives) return false; @@ -376,6 +377,8 @@ MUTATOR_HOOKFUNCTION(lms, OnEntityPreSpawn) MUTATOR_HOOKFUNCTION(lms, ItemTouch) { + if(MUTATOR_RETURNVALUE) return false; + entity item = M_ARGV(0, entity); entity toucher = M_ARGV(1, entity); diff --git a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc index a23fc3697..13403b9e3 100644 --- a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc @@ -509,6 +509,8 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDies) MUTATOR_HOOKFUNCTION(mutator_instagib, ItemTouch) { + if(MUTATOR_RETURNVALUE) return false; + entity item = M_ARGV(0, entity); entity toucher = M_ARGV(1, entity); @@ -542,6 +544,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, ItemTouch) MUTATOR_HOOKFUNCTION(mutator_instagib, OnEntityPreSpawn) { + if (MUTATOR_RETURNVALUE) return false; if (!autocvar_g_powerups) { return; } entity ent = M_ARGV(0, entity); // Can't use .itemdef here