X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcommon.qc;h=73bf0df4f7d279bb92709f1203a711c290831edf;hb=8c8a22011714768f8c5b3ac887d0fd099fc08d8b;hp=e95cf4c6585ba07ec0aa45008bdaf747bb728f8f;hpb=7eb9a7c4ea3b9aff3a780584931a75a1fe25a8ad;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index e95cf4c65..73bf0df4f 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -24,11 +24,11 @@ string GetCallerName(entity caller) // verify that the client provided is acceptable for use float VerifyClientEntity(entity client, float must_be_real, float must_be_bots) { - if not(client.flags & FL_CLIENT) + if not(IS_CLIENT(client)) return CLIENT_DOESNT_EXIST; - else if(must_be_real && (clienttype(client) != CLIENTTYPE_REAL)) + else if(must_be_real && !IS_REAL_CLIENT(client)) return CLIENT_NOT_REAL; - else if(must_be_bots && (clienttype(client) != CLIENTTYPE_BOT)) + else if(must_be_bots && !IS_BOT_CLIENT(client)) return CLIENT_NOT_BOT; return CLIENT_ACCEPTABLE; @@ -182,7 +182,7 @@ void timeout_handler_think() Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_ENDING, timeout_time); if(timeout_time == autocvar_sv_timeout_resumetime) // play a warning sound when only seconds are left - Announce("prepareforbattle"); + Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_PREPARE); self.nextthink = time + TIMEOUT_SLOWMO_VALUE; // think again in one second timeout_time -= 1; // decrease the time counter @@ -557,7 +557,7 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMAN else if(inWarmupStage && !g_warmup_allow_timeout) { print_to(caller, "^7Error: You can not call a timeout in warmup-stage."); } else if(time < game_starttime) { print_to(caller, "^7Error: You can not call a timeout while the map is being restarted."); } else if(caller && (caller.allowed_timeouts < 1)) { print_to(caller, "^7Error: You already used all your timeout calls for this map."); } - else if(caller && (caller.classname != "player")) { print_to(caller, "^7Error: You must be a player to call a timeout."); } + else if(caller && !IS_PLAYER(caller)) { print_to(caller, "^7Error: You must be a player to call a timeout."); } else if((autocvar_timelimit) && (last_possible_timeout < time - game_starttime)) { print_to(caller, "^7Error: It is too late to call a timeout now!"); } else // everything should be okay, proceed with starting the timeout @@ -575,7 +575,7 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMAN timeout_handler.think = timeout_handler_think; timeout_handler.nextthink = time; // always let the entity think asap - Announce("timeoutcalled"); + Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_TIMEOUT); } } else { print_to(caller, "^1Timeouts are not allowed to be called, enable them with sv_timeout 1.\n"); } @@ -613,7 +613,7 @@ void CommonCommand_who(float request, entity caller, float argc) total_listed_players = 0; FOR_EACH_CLIENT(tmp_player) { - is_bot = (clienttype(tmp_player) == CLIENTTYPE_BOT); + is_bot = (IS_BOT_CLIENT(tmp_player)); if(is_bot) {