diff options
author | Strangerke | 2018-04-20 07:21:06 +0200 |
---|---|---|
committer | Strangerke | 2018-04-20 07:21:06 +0200 |
commit | 7af31d6614766c2e53c5b1e6240309e2f9382abe (patch) | |
tree | 84bf24491b7ed1ee416e2695ed9fa914b3b46ce5 /engines | |
parent | 2f00d52a2344552242afb69d27ff4a459559a0fc (diff) | |
download | scummvm-rg350-7af31d6614766c2e53c5b1e6240309e2f9382abe.tar.gz scummvm-rg350-7af31d6614766c2e53c5b1e6240309e2f9382abe.tar.bz2 scummvm-rg350-7af31d6614766c2e53c5b1e6240309e2f9382abe.zip |
LILLIPUT: Add safeguard in homeInPathFinding
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lilliput/lilliput.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 800d5b322d..97767a6005 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -1389,7 +1389,10 @@ void LilliputEngine::homeInPathFinding(int index) { if (enclosureSrc == -1) { int tmpVal = checkOuterEnclosure(_characterTargetPos[index]); - _characterSubTargetPos[index] = _portalPos[tmpVal]; + if (tmpVal == -1) + warning("homeInPathFinding: Unexpected negative index"); + else + _characterSubTargetPos[index] = _portalPos[tmpVal]; return; } |