X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcommon.qc;h=53ad41d3551d0d7de500622a31f224ec87b52ef1;hb=0f6085c8ea46125d87ca81ec7f5e82f73c08f958;hp=99313b38bf4f9e3b2331fcc5a6d75fb09622b6b4;hpb=e0c9aa1d9b98b75a17051868efc2d97e72d13c32;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 99313b38b..53ad41d35 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -63,6 +63,7 @@ entity GetIndexedEntity(float argc, float start_index) next_token = -1; index = start_index; + selection = world; if(argc > start_index) { @@ -80,6 +81,8 @@ entity GetIndexedEntity(float argc, float start_index) tmp_number = stof(argv(index)); ++index; } + else + tmp_number = 0; } else // maybe it's ONLY a number? { @@ -123,6 +126,7 @@ entity GetFilteredEntity(string input) } else { + selection = world; FOR_EACH_CLIENT(tmp_player) if (strdecolorize(tmp_player.netname) == strdecolorize(input)) selection = tmp_player; @@ -137,12 +141,12 @@ float GetFilteredNumber(string input) entity selection = GetFilteredEntity(input); float output; - if(selection) { output = num_for_edict(selection); } + output = num_for_edict(selection); return output; } -// switch between sprint and print depending on whether the reciever is the server or a player +// switch between sprint and print depending on whether the receiver is the server or a player void print_to(entity to, string input) { if(to) @@ -568,7 +572,7 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMAN { if(caller) { caller.allowed_timeouts -= 1; } - bprint(GetCallerName(caller), " ^7called a timeout", (caller ? strcat(" (", ftos(caller.allowed_timeouts), " timeout(s) left)") : string_null), "!\n"); // write a bprint who started the timeout (and how many they have left) + bprint(GetCallerName(caller), " ^7called a timeout", (caller ? strcat(" (", ftos(caller.allowed_timeouts), " timeout(s) left)") : ""), "!\n"); // write a bprint who started the timeout (and how many they have left) timeout_status = TIMEOUT_LEADTIME; timeout_caller = caller; @@ -610,10 +614,11 @@ void CommonCommand_who(float request, entity caller, float argc) string separator = strreplace("%", " ", strcat((argv(1) ? argv(1) : " "), "^7")); string tmp_netaddress, tmp_crypto_idfp; - print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : string_null), ":")); + print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : ""), ":")); print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20s %-5s %-3s %-9s %-16s %s "), "ent", "nickname", "ping", "pl", "time", "ip", "crypto_id")); + total_listed_players = 0; FOR_EACH_CLIENT(tmp_player) { is_bot = (clienttype(tmp_player) == CLIENTTYPE_BOT); @@ -759,4 +764,4 @@ void CommonCommand_macro_write_aliases(float fh) #undef COMMON_COMMAND return; -} \ No newline at end of file +}