LILLIPUT: Add safeguard in homeInPathFinding

This commit is contained in:
Strangerke 2018-04-20 07:21:06 +02:00
parent 2f00d52a23
commit 7af31d6614

View File

@ -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;
}