X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcommon.qc;h=3c97737e541d559ab13723d0091a6d361986adcd;hp=14f7439a4fcc35f3971acb942f9a75e9121dc809;hb=6a611fb362129440369cb09a590023d6292102e9;hpb=74cebbb48d9481bb83eccb4438283f319352cb74 diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 14f7439a4..3c97737e5 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -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)) { @@ -200,12 +200,12 @@ 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); - self.nextthink = time + TIMEOUT_SLOWMO_VALUE; // think again in one second + this.nextthink = time + TIMEOUT_SLOWMO_VALUE; // think again in one second timeout_time -= 1; // decrease the time counter } else // time to end the timeout @@ -230,9 +230,9 @@ 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); - self.nextthink = time + 1; // think again in one second + this.nextthink = time + 1; // think again in one second timeout_leadtime -= 1; // decrease the time counter } else // time to begin the timeout @@ -254,7 +254,7 @@ void timeout_handler_think(entity this) it.lastV_angle = it.v_angle; )); - self.nextthink = time; // think again next frame to handle it under TIMEOUT_ACTIVE code + this.nextthink = time; // think again next frame to handle it under TIMEOUT_ACTIVE code } return; @@ -361,7 +361,6 @@ void CommonCommand_editmob(int request, entity caller, int argc) int moveflag, tmp_moncount = 0; string arg_lower = strtolower(argument); moveflag = (argv(3)) ? stof(argv(3)) : 1; // follow owner if not defined - ret_string = "Monster spawning is currently disabled by a mutator"; if (arg_lower == "list") { print_to(caller, monsterlist_reply); return; } @@ -373,7 +372,7 @@ void CommonCommand_editmob(int request, entity caller, int argc) 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 (MUTATOR_CALLHOOK(AllowMobSpawning, caller)) { print_to(caller, M_ARGV(1, string)); return; } if (caller.vehicle) { print_to(caller, "You can't spawn monsters while driving a vehicle"); 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; } @@ -401,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; } @@ -433,7 +432,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 (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFO(ret_string, "\n"); return; } + if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFO(M_ARGV(0, string), "\n"); return; } int tmp_remcount = 0; @@ -741,7 +740,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"); }