diff options
author | Darkvater <darkvater@openttd.org> | 2006-10-14 22:31:18 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-10-14 22:31:18 +0000 |
commit | 6b6d908308c9aaf32f7b99500715319aaab1a51c (patch) | |
tree | 52f21281bd10b45ef340a15357a04bf130b9b554 /console_cmds.c | |
parent | 9732c129c16dea48e69188b75c2e39f9faacf86f (diff) | |
download | openttd-6b6d908308c9aaf32f7b99500715319aaab1a51c.tar.xz |
(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an
actual playable player (< MAX_PLAYERS) or not.
Diffstat (limited to 'console_cmds.c')
-rw-r--r-- | console_cmds.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/console_cmds.c b/console_cmds.c index feddff87d..f49537ff0 100644 --- a/console_cmds.c +++ b/console_cmds.c @@ -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; } |