From a43381cf991fde13f7e190dd7cdd6fd235fb2af2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 27 Oct 2019 21:42:07 +0000 Subject: [PATCH] SCUMM HE: Fix network start at the game start --- engines/scumm/he/moonbase/net_main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/engines/scumm/he/moonbase/net_main.cpp b/engines/scumm/he/moonbase/net_main.cpp index cd25a2291ef..cef39c6ad18 100644 --- a/engines/scumm/he/moonbase/net_main.cpp +++ b/engines/scumm/he/moonbase/net_main.cpp @@ -547,6 +547,11 @@ bool Net::remoteReceiveData() { void Net::remoteReceiveDataCallback(Common::JSONValue *response) { debug(1, "remoteReceiveData: Got: '%s'", response->stringify().c_str()); + if (!response->hasChild("size")) { + warning("Net::remoteReceiveDataCallback(): invalid response"); + return; + } + _packetsize = response->child("size")->asIntegerNumber(); if (!_packetsize) @@ -565,6 +570,9 @@ void Net::unpackageArray(int arrayId, byte *data, int len) { void Net::doNetworkOnceAFrame(int msecs) { + if (_sessionid == -1 || _myUserId == -1) + return; + uint32 tickCount = g_system->getMillis() + msecs; while (remoteReceiveData()) {