fixed amb1591 - mods like IOS:S which, in listen server mode add bots before the player, caused crashes in SM

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402050
This commit is contained in:
David Anderson
2008-04-12 02:18:03 +00:00
parent 800838d76a
commit 2fbd32cd1a
3 changed files with 31 additions and 6 deletions
+4 -4
View File
@@ -379,14 +379,14 @@ void ConCmdManager::InternalDispatch(const CCommand &command)
/* On a listen server, sometimes the server host's client index can be set as 0.
* So index 1 is passed to the command callback to correct this potential problem.
*/
if (client == 0 && !engine->IsDedicatedServer())
if (!engine->IsDedicatedServer())
{
pHook->pf->PushCell(1);
} else {
pHook->pf->PushCell(client);
client = g_Players.ListenClient();
}
pHook->pf->PushCell(client);
pHook->pf->PushCell(args);
if (pHook->pf->Execute(&tempres) == SP_ERROR_NONE)
{
if (tempres > result)