aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-10-27 21:42:07 +0000
committerEugene Sandulenko2019-10-27 21:42:07 +0000
commita43381cf991fde13f7e190dd7cdd6fd235fb2af2 (patch)
treed322d3b848e4caa6bb85a472db462944d147d9ea
parente6d9148061cb863e642ab4b5ce129ee429864adb (diff)
downloadscummvm-rg350-a43381cf991fde13f7e190dd7cdd6fd235fb2af2.tar.gz
scummvm-rg350-a43381cf991fde13f7e190dd7cdd6fd235fb2af2.tar.bz2
scummvm-rg350-a43381cf991fde13f7e190dd7cdd6fd235fb2af2.zip
SCUMM HE: Fix network start at the game start
-rw-r--r--engines/scumm/he/moonbase/net_main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/scumm/he/moonbase/net_main.cpp b/engines/scumm/he/moonbase/net_main.cpp
index cd25a2291e..cef39c6ad1 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()) {