X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcommon.qc;h=14965d8c73be1189f3c0abb44675cd0af0ffcedc;hb=d271f27a5ac351a3a7b39636932f6d661492be1d;hp=a252b1f501130a5e2705d1efe391d78f980d4411;hpb=7f5ad47610dc8b5580cc96ae961a57cca96e6975;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index a252b1f50..14965d8c7 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -1,11 +1,12 @@ -#include "../../common/command/command.qh" +#include "common.qh" +#include #include "common.qh" #include "../scores.qh" -#include "../../common/monsters/all.qh" -#include "../../common/notifications.qh" -#include "../../lib/warpzone/common.qh" +#include +#include +#include // ==================================================== @@ -245,7 +246,7 @@ void timeout_handler_think() // reset all the flood variables FOREACH_CLIENT(true, LAMBDA( - it.nickspamcount = it.nickspamtime = it.floodcontrol_chat = + it.nickspamcount = it.nickspamtime = it.floodcontrol_chat = it.floodcontrol_chatteam = it.floodcontrol_chattell = it.floodcontrol_voice = it.floodcontrol_voiceteam = 0; )); @@ -320,7 +321,6 @@ void CommonCommand_cvar_purechanges(float request, entity caller) void CommonCommand_editmob(int request, entity caller, int argc) { - SELFPARAM(); switch (request) { case CMD_REQUEST_COMMAND: @@ -330,8 +330,8 @@ void CommonCommand_editmob(int request, entity caller, int argc) if (caller) { - makevectors(self.v_angle); - WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 100, MOVE_NORMAL, self); + makevectors(caller.v_angle); + WarpZone_TraceLine(caller.origin + caller.view_ofs, caller.origin + caller.view_ofs + v_forward * 100, MOVE_NORMAL, caller); } entity mon = trace_ent; @@ -367,18 +367,18 @@ void CommonCommand_editmob(int request, entity caller, int argc) if (arg_lower == "list") { print_to(caller, monsterlist_reply); return; } - FOR_EACH_MONSTER(mon) - { - if (mon.realowner == caller) ++tmp_moncount; - } + FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, LAMBDA( + if(it.realowner == caller) + ++tmp_moncount; + )); if (!autocvar_g_monsters) { print_to(caller, "Monsters are disabled"); return; } if (autocvar_g_monsters_max <= 0 || autocvar_g_monsters_max_perplayer <= 0) { print_to(caller, "Monster spawning is disabled"); return; } if (!IS_PLAYER(caller)) { print_to(caller, "You must be playing to spawn a monster"); return; } if (MUTATOR_CALLHOOK(AllowMobSpawning)) { print_to(caller, ret_string); return; } if (caller.vehicle) { print_to(caller, "You can't spawn monsters while driving a vehicle"); return; } - if (caller.frozen) { print_to(caller, "You can't spawn monsters while frozen"); return; } - if (caller.deadflag != DEAD_NO) { print_to(caller, "You can't spawn monsters while dead"); return; } + if (STAT(FROZEN, caller)) { print_to(caller, "You can't spawn monsters while frozen"); return; } + if (IS_DEAD(caller)) { print_to(caller, "You can't spawn monsters while dead"); return; } if (tmp_moncount >= autocvar_g_monsters_max) { print_to(caller, "The maximum monster count has been reached"); return; } if (tmp_moncount >= autocvar_g_monsters_max_perplayer) { print_to(caller, "You can't spawn any more monsters"); return; } @@ -438,13 +438,11 @@ void CommonCommand_editmob(int request, entity caller, int argc) if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFO(ret_string, "\n"); return; } int tmp_remcount = 0; - entity tmp_entity; - FOR_EACH_MONSTER(tmp_entity) - { - Monster_Remove(tmp_entity); + FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, LAMBDA( + Monster_Remove(it); ++tmp_remcount; - } + )); monsters_total = monsters_killed = totalspawned = 0;