]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix another gamemode specific check
authorMario <mario@smbclan.net>
Wed, 14 Oct 2015 15:07:14 +0000 (01:07 +1000)
committerMario <mario@smbclan.net>
Wed, 14 Oct 2015 15:07:14 +0000 (01:07 +1000)
qcsrc/server/command/common.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/gamemode_invasion.qc

index fee82a7e4b5933a4263b191b4e3fb543b9e97e18..8d804587232bb57bc1d03f6423969662a57586b8 100644 (file)
@@ -425,7 +425,7 @@ void CommonCommand_editmob(int request, entity caller, int argc)
                                case "butcher":
                                {
                                        if(caller) { print_to(caller, "This command is not available to players"); return; }
-                                       if(g_invasion) { print_to(caller, "This command does not work during an invasion!"); return; }
+                                       if(MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFO(ret_string, "\n"); return; }
 
                                        int tmp_remcount = 0;
                                        entity tmp_entity;
index 1af9a9fbf5986ac9b78a52341dcef6f09179864f..e446816e50e4fc01e9fd6c74dfdb85a5b26e83b1 100644 (file)
@@ -765,4 +765,10 @@ MUTATOR_HOOKABLE(SetWeaponArena, EV_SetWeaponArena);
     /**/ i(entity, frag_target) \
     /**/
 MUTATOR_HOOKABLE(DropSpecialItems, EV_DropSpecialItems);
+
+/**
+ * called when an admin tries to kill all monsters
+ * return 1 to prevent spawning
+ */
+MUTATOR_HOOKABLE(AllowMobButcher, EV_NO_ARGS);
 #endif
index c6f6a02f63f521d3d2a1b0d73927ecffa23c9419..f1b942919f60b09f70d8b8c2a4dbbe7a89e875cf 100644 (file)
@@ -411,6 +411,12 @@ MUTATOR_HOOKFUNCTION(inv, GetTeamCount, CBC_ORDER_EXCLUSIVE)
        return false;
 }
 
+MUTATOR_HOOKFUNCTION(inv, AllowMobButcher)
+{
+       ret_string = "This command does not work during an invasion!";
+       return true;
+}
+
 void invasion_ScoreRules(float inv_teams)
 {
        if(inv_teams) { CheckAllowedTeams(world); }