[Scummvm-cvs-logs] scummvm master -> b670c02835f52673064cce9b025a353ca8fe82ce

sev- sev at scummvm.org
Sun Aug 14 21:51:46 CEST 2016


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
35a1ad3463 FULLPIPE: Add missing list purge in MovGraph2::findMinPath
b670c02835 FULLPIPE: Rearrange code and fix flags initalization in MovGraph2::buildMovInfo1MessageQueue


Commit: 35a1ad3463a5acc7003572b5dfdb488e77f218df
    https://github.com/scummvm/scummvm/commit/35a1ad3463a5acc7003572b5dfdb488e77f218df
Author: Retro-Junk (bambarbee at yandex.ru)
Date: 2016-08-14T21:43:29+02:00

Commit Message:
FULLPIPE: Add missing list purge in MovGraph2::findMinPath

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index a8fe8b7..cb45ca4 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -2818,6 +2818,8 @@ double MovGraph2::findMinPath(LinkInfo *linkInfoSource, LinkInfo *linkInfoDest,
 			newDistance = findMinPath(&linkInfoWorkSource, linkInfoDest, &tmpList);
 
 			if (newDistance >= 0 && (minDistance < 0.0 || newDistance < minDistance)) {
+				listObj->clear();
+
 				listObj->push_back(linkInfoSource->link);
 				listObj->push_back(tmpList);
 


Commit: b670c02835f52673064cce9b025a353ca8fe82ce
    https://github.com/scummvm/scummvm/commit/b670c02835f52673064cce9b025a353ca8fe82ce
Author: Retro-Junk (bambarbee at yandex.ru)
Date: 2016-08-14T21:43:42+02:00

Commit Message:
FULLPIPE: Rearrange code and fix flags initalization in MovGraph2::buildMovInfo1MessageQueue

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index cb45ca4..590a83d 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -2042,23 +2042,12 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
 			movinfo.pt2.y = movInfo->items[i + 2]->y;
 			movinfo.distance2 = movInfo->items[i + 2]->distance;
 
-			if (i >= movInfo->itemsCount - 4
-				 || movInfo->items[i + 2]->subIndex == 10
-				 || movInfo->items[i + 3]->subIndex == 10
-				 || movInfo->items[i + 2]->subIndex == movInfo->items[i + 3]->subIndex
-				 || movInfo->items[i + 4]->subIndex != 10) {
-				if (i >= movInfo->itemsCount - 3
-					 || movInfo->items[i + 2]->subIndex == 10
-					 || movInfo->items[i + 3]->subIndex == 10
-					 || movInfo->items[i + 2]->subIndex == movInfo->items[i + 3]->subIndex) {
-					movinfo.flags &= 3;
-				} else {
-					MG2I *m = &_items2[movInfo->index]->_subItems[movInfo->items[i + 2]->subIndex]._turnS[movInfo->items[i + 3]->subIndex];
-					movinfo.pt2.x -= m->_mx;
-					movinfo.pt2.y -= m->_my;
-					movinfo.flags &= 3;
-				}
-			} else {
+			if (i < movInfo->itemsCount - 4
+				&& movInfo->items[i + 2]->subIndex != 10
+				&& movInfo->items[i + 3]->subIndex != 10
+				&& movInfo->items[i + 2]->subIndex != movInfo->items[i + 3]->subIndex
+				&& movInfo->items[i + 4]->subIndex == 10) {
+
 				MG2I *m = &_items2[movInfo->index]->_subItems[movInfo->items[i + 2]->subIndex]._turn[movInfo->items[i + 3]->subIndex];
 
 				if (movinfo.item1Index && movinfo.item1Index != 1) {
@@ -2068,7 +2057,21 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
 					movinfo.pt2.x -= m->_mx;
 					movinfo.flags = (movinfo.flags & 2) | 1;
 				}
+
+			} else if (i < movInfo->itemsCount - 3
+				&& movInfo->items[i + 2]->subIndex != 10
+				&& movInfo->items[i + 3]->subIndex != 10
+				&& movInfo->items[i + 2]->subIndex != movInfo->items[i + 3]->subIndex) {
+
+				MG2I *m = &_items2[movInfo->index]->_subItems[movInfo->items[i + 2]->subIndex]._turnS[movInfo->items[i + 3]->subIndex];
+				movinfo.pt2.x -= m->_mx;
+				movinfo.pt2.y -= m->_my;
+				movinfo.flags = (movinfo.flags & 2) | (movInfo->flags & 1);
+
+			} else {
+				movinfo.flags = (movinfo.flags & 2) | (movInfo->flags & 1);
 			}
+
 			i++; // intentional
 
 			MessageQueue *mq2 = genMovement(&movinfo);






More information about the Scummvm-git-logs mailing list