[Scummvm-cvs-logs] scummvm master -> be0f082ab60b638ec0780e6d748dfe7753299a51
Strangerke
Strangerke at scummvm.org
Sun Apr 21 00:02:19 CEST 2013
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
be0f082ab6 HOPKINS: Improve test on lineData in testLine. CID 1003821
Commit: be0f082ab60b638ec0780e6d748dfe7753299a51
https://github.com/scummvm/scummvm/commit/be0f082ab60b638ec0780e6d748dfe7753299a51
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-04-20T15:00:54-07:00
Commit Message:
HOPKINS: Improve test on lineData in testLine. CID 1003821
Changed paths:
engines/hopkins/lines.cpp
diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp
index 379405b..3fe72d8 100644
--- a/engines/hopkins/lines.cpp
+++ b/engines/hopkins/lines.cpp
@@ -2440,21 +2440,22 @@ int LinesManager::testLine(int paramX, int paramY, int *testValue, int *foundLin
for (int idx = _lastLine + 1; idx < _linesNumb + 1; idx++) {
lineData = _lineItem[idx]._lineData;
lineDataEndIdx = _lineItem[idx]._lineDataEndIdx;
- if (lineData) {
- if (lineData[0] == paramX && lineData[1] == paramY) {
- *testValue = 1;
- int posX = lineData[2 * (lineDataEndIdx - 1)];
- int posY = lineData[2 * (lineDataEndIdx - 1) + 1];
- if (_lineItem[idx]._directionRouteInc == DIR_DOWN || _lineItem[idx]._directionRouteInc == DIR_UP)
- posY += 2;
- if (_lineItem[idx]._directionRouteInc == DIR_RIGHT || _lineItem[idx]._directionRouteDec == DIR_LEFT)
- posX += 2;
- if (!checkCollisionLine(posX, posY, &collDataIdx, &collLineIdx, 0, _lastLine))
- error("Error in test line");
- *foundLineIdx = collLineIdx;
- *foundDataIdx = collDataIdx;
- return idx;
- }
+ if (!lineData)
+ continue;
+
+ if (lineData[0] == paramX && lineData[1] == paramY) {
+ *testValue = 1;
+ int posX = lineData[2 * (lineDataEndIdx - 1)];
+ int posY = lineData[2 * (lineDataEndIdx - 1) + 1];
+ if (_lineItem[idx]._directionRouteInc == DIR_DOWN || _lineItem[idx]._directionRouteInc == DIR_UP)
+ posY += 2;
+ if (_lineItem[idx]._directionRouteInc == DIR_RIGHT || _lineItem[idx]._directionRouteDec == DIR_LEFT)
+ posX += 2;
+ if (!checkCollisionLine(posX, posY, &collDataIdx, &collLineIdx, 0, _lastLine))
+ error("Error in test line");
+ *foundLineIdx = collLineIdx;
+ *foundDataIdx = collDataIdx;
+ return idx;
}
if (lineDataEndIdx > 0) {
More information about the Scummvm-git-logs
mailing list