]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Prevent picking up weapons when carrying the ball in nexball
authorMario <mario@smbclan.net>
Fri, 24 Jun 2016 07:23:20 +0000 (17:23 +1000)
committerMario <mario@smbclan.net>
Fri, 24 Jun 2016 07:23:20 +0000 (17:23 +1000)
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc

index 46b4e034558b69f45e150d03a8cbf732155dd197..291f201c4d1a6a7dc86f923b7104d385e816093f 100644 (file)
@@ -1073,6 +1073,17 @@ MUTATOR_HOOKFUNCTION(nb, FilterItem)
        return false;
 }
 
+MUTATOR_HOOKFUNCTION(nb, ItemTouch)
+{
+       entity item = M_ARGV(0, entity);
+       entity toucher = M_ARGV(1, entity);
+
+       if(item.weapon && toucher.ballcarried)
+               return MUT_ITEMTOUCH_RETURN; // no new weapons for you, mister!
+
+       return MUT_ITEMTOUCH_CONTINUE;
+}
+
 MUTATOR_HOOKFUNCTION(nb, GetTeamCount)
 {
        M_ARGV(1, string) = "nexball_team";