[Scummvm-cvs-logs] SF.net SVN: scummvm:[50922] scummvm/trunk/engines/sci/engine/kmovement.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Thu Jul 15 23:28:49 CEST 2010


Revision: 50922
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50922&view=rev
Author:   m_kiewitz
Date:     2010-07-15 21:28:48 +0000 (Thu, 15 Jul 2010)

Log Message:
-----------
SCI: kDoBresen now returns result of CantBeHere() like sierra sci does it, also adding another comment about r50921

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kmovement.cpp

Modified: scummvm/trunk/engines/sci/engine/kmovement.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmovement.cpp	2010-07-15 21:10:50 UTC (rev 50921)
+++ scummvm/trunk/engines/sci/engine/kmovement.cpp	2010-07-15 21:28:48 UTC (rev 50922)
@@ -316,14 +316,21 @@
 
 	debugC(2, kDebugLevelBresen, "New data: (x,y)=(%d,%d), di=%d", x, y, bdi);
 
+	bool collision = false;
+	reg_t cantBeHere = NULL_REG;
+
 	if (SELECTOR(cantBeHere) != -1) {
 		invokeSelector(s, client, SELECTOR(cantBeHere), argc, argv);
-		s->r_acc = make_reg(0, !s->r_acc.offset);
+		if (!s->r_acc.isNull())
+			collision = true;
+		cantBeHere = s->r_acc;
 	} else {
 		invokeSelector(s, client, SELECTOR(canBeHere), argc, argv);
+		if (s->r_acc.isNull())
+			collision = true;
 	}
 
-	if (!s->r_acc.offset) { // Contains the return value
+	if (collision) {
 		signal = readSelectorValue(segMan, client, SELECTOR(signal));
 
 		writeSelectorValue(segMan, client, SELECTOR(x), oldx);
@@ -332,12 +339,15 @@
 
 		debugC(2, kDebugLevelBresen, "Finished mover %04x:%04x by collision", PRINT_REG(mover));
 		// we shall not set completed in this case, sierra sci also doesn't do it
+		//  if we set call .moveDone in those cases qfg1 vga gate at the castle and lsl1 casino door will not work
 	}
 
 	if ((getSciVersion() >= SCI_VERSION_1_EGA))
 		if (completed)
 			invokeSelector(s, mover, SELECTOR(moveDone), argc, argv);
 
+	if (SELECTOR(cantBeHere) != -1)
+		return cantBeHere;
 	return make_reg(0, completed);
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list