X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcommon.qc;h=357a33eba2d5d1cb398a138883ccd83b606fcca5;hb=06ac66a5edaa645e19ed9a6482409e8656a65b1d;hp=ae0a02538a356de409bf375c64ea4ea721e677ab;hpb=df2fe9b28cb6210b671bec6d5ae834ff4eb2e2db;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index ae0a02538..357a33eba 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -1,5 +1,5 @@ #include "common.qh" -#include +#include #include "common.qh" #include "../scores.qh" @@ -80,7 +80,7 @@ entity GetIndexedEntity(float argc, float start_index) next_token = -1; index = start_index; - selection = world; + selection = NULL; if (argc > start_index) { @@ -147,7 +147,7 @@ entity GetFilteredEntity(string input) } else { - selection = world; + selection = NULL; FOREACH_CLIENT(true, LAMBDA( if(strdecolorize(it.netname) == strdecolorize(input)) { @@ -189,7 +189,7 @@ void timeout_handler_reset(entity this) timeout_time = 0; timeout_leadtime = 0; - remove(this); + delete(this); } void timeout_handler_think(entity this) @@ -200,10 +200,10 @@ void timeout_handler_think(entity this) { if (timeout_time > 0) // countdown is still going { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_ENDING, timeout_time); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_TIMEOUT_ENDING, timeout_time); if (timeout_time == autocvar_sv_timeout_resumetime) // play a warning sound when only seconds are left - Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_PREPARE); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_PREPARE); this.nextthink = time + TIMEOUT_SLOWMO_VALUE; // think again in one second timeout_time -= 1; // decrease the time counter @@ -230,7 +230,7 @@ void timeout_handler_think(entity this) { if (timeout_leadtime > 0) // countdown is still going { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime); this.nextthink = time + 1; // think again in one second timeout_leadtime -= 1; // decrease the time counter @@ -364,10 +364,10 @@ void CommonCommand_editmob(int request, entity caller, int argc) if (arg_lower == "list") { print_to(caller, monsterlist_reply); return; } - FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, LAMBDA( - if(it.realowner == caller) - ++tmp_moncount; - )); + IL_EACH(g_monsters, 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; } @@ -400,7 +400,7 @@ void CommonCommand_editmob(int request, entity caller, int argc) if (mon.realowner != caller && autocvar_g_monsters_edit < 2) { print_to(caller, "This monster does not belong to you"); return; } if (!is_visible) { print_to(caller, "You must look at your monster to edit it"); return; } - Damage(mon, world, world, mon.health + mon.max_health + 200, DEATH_KILL.m_id, mon.origin, '0 0 0'); + Damage(mon, NULL, NULL, mon.health + mon.max_health + 200, DEATH_KILL.m_id, mon.origin, '0 0 0'); print_to(caller, strcat("Your pet '", mon.monster_name, "' has been brutally mutilated")); return; } @@ -436,10 +436,12 @@ void CommonCommand_editmob(int request, entity caller, int argc) int tmp_remcount = 0; - FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, LAMBDA( + IL_EACH(g_monsters, true, + { Monster_Remove(it); ++tmp_remcount; - )); + }); + IL_CLEAR(g_monsters); monsters_total = monsters_killed = totalspawned = 0; @@ -740,7 +742,7 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMA setthink(timeout_handler, timeout_handler_think); timeout_handler.nextthink = time; // always let the entity think asap - Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_TIMEOUT); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_TIMEOUT); } } else { print_to(caller, "^1Timeouts are not allowed to be called, enable them with sv_timeout 1.\n"); }