(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an

actual playable player (< MAX_PLAYERS) or not.
This commit is contained in:
Darkvater
2006-10-14 22:31:18 +00:00
parent 9732c129c1
commit 6b6d908308
15 changed files with 50 additions and 49 deletions

View File

@@ -1290,12 +1290,12 @@ DEF_CONSOLE_HOOK(ConHookRconPW)
bool NetworkChangeCompanyPassword(byte argc, char *argv[])
{
if (argc == 0) {
if (_local_player >= MAX_PLAYERS) return true; // dedicated server
if (!IsValidPlayer(_local_player)) return true; // dedicated server
IConsolePrintF(_icolour_warn, "Current value for 'company_pw': %s", _network_player_info[_local_player].password);
return true;
}
if (_local_player >= MAX_PLAYERS) {
if (!IsValidPlayer(_local_player)) {
IConsoleError("You have to own a company to make use of this command.");
return false;
}