[Scummvm-git-logs] scummvm master -> 93db404c9454ebdd8c7e4ba55c8ee918d45b9c82

whiterandrek whiterandrek at gmail.com
Thu May 21 10:01:02 UTC 2020


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

Summary:
b4f6d55cd4 PETKA: fix crash
39c3bfd264 PETKA: fix Circle and Break operations
93db404c94 PETKA: named magic number in BigDialogue


Commit: b4f6d55cd45b3b4977be854f069760c625baab52
    https://github.com/scummvm/scummvm/commit/b4f6d55cd45b3b4977be854f069760c625baab52
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-05-21T12:59:04+03:00

Commit Message:
PETKA: fix crash

Changed paths:
    engines/petka/objects/object.cpp


diff --git a/engines/petka/objects/object.cpp b/engines/petka/objects/object.cpp
index 3876441057..4acd5e57f9 100644
--- a/engines/petka/objects/object.cpp
+++ b/engines/petka/objects/object.cpp
@@ -91,11 +91,11 @@ void processSavedReaction(QReaction **reaction, QMessageObject *sender) {
 		}
 		case kWalk:
 		case kWalkTo:
-			g_vm->getQSystem()->_petka->setReactionAfterWalk(i, &r, sender, 1);
-			break;
+			g_vm->getQSystem()->_petka->setReactionAfterWalk(i, reaction, sender, 1);
+			return;
 		case kWalkVich:
-			g_vm->getQSystem()->_chapayev->setReactionAfterWalk(i, &r, sender, 1);
-			break;
+			g_vm->getQSystem()->_chapayev->setReactionAfterWalk(i, reaction, sender, 1);
+			return;
 		default:
 			processed = false;
 			break;


Commit: 39c3bfd264418211e4c0c3f4dd81361b1d96938b
    https://github.com/scummvm/scummvm/commit/39c3bfd264418211e4c0c3f4dd81361b1d96938b
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-05-21T12:59:48+03:00

Commit Message:
PETKA: fix Circle and Break operations

Changed paths:
    engines/petka/big_dialogue.cpp


diff --git a/engines/petka/big_dialogue.cpp b/engines/petka/big_dialogue.cpp
index 79eb655a22..cc12508547 100644
--- a/engines/petka/big_dialogue.cpp
+++ b/engines/petka/big_dialogue.cpp
@@ -124,14 +124,16 @@ const Common::U32String *BigDialogue::getSpeechInfo(int *talkerId, const char **
 		*talkerId = _speeches[index].speakerId;
 		return &_speeches[index].text;
 	}
-	case kOperationCircle:
+	case kOperationCircle: {
+		const uint current = _currOp->circle.curr;
 		_currOp += 1;
-		for (uint i = 0; i < _currOp->circle.count; ++i) {
+		for (uint i = 0; i < current; ++i) {
 			while (_currOp->type != kOperationBreak)
 				_currOp += 1;
 			_currOp += 1;
 		}
 		assert(_currOp->type == kOperationPlay);
+	}
 		// fall through
 	case kOperationPlay:
 		*soundName = _speeches[_currOp->play.messageIndex].soundName;
@@ -315,7 +317,7 @@ void BigDialogue::next(int choice) {
 	while (true) {
 		switch (_currOp->type) {
 		case kOperationBreak:
-			while (_currOp->type != kOperationMenu || _currOp->type != kOperationCircle) {
+			while (_currOp->type != kOperationMenu && _currOp->type != kOperationCircle) {
 				_currOp--;
 			}
 			next(choice);


Commit: 93db404c9454ebdd8c7e4ba55c8ee918d45b9c82
    https://github.com/scummvm/scummvm/commit/93db404c9454ebdd8c7e4ba55c8ee918d45b9c82
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-05-21T13:00:40+03:00

Commit Message:
PETKA: named magic number in BigDialogue

Changed paths:
    engines/petka/big_dialogue.cpp


diff --git a/engines/petka/big_dialogue.cpp b/engines/petka/big_dialogue.cpp
index cc12508547..903993f095 100644
--- a/engines/petka/big_dialogue.cpp
+++ b/engines/petka/big_dialogue.cpp
@@ -33,6 +33,8 @@
 
 namespace Petka {
 
+const uint16 kFallback = 0xFFFE;
+
 BigDialogue::BigDialogue() {
 	_currOp = nullptr;
 	_startOpIndex = 0;
@@ -163,7 +165,7 @@ const DialogHandler *BigDialogue::findHandler(uint objId, uint opcode, bool *res
 				continue;
 			}
 			for (uint j = 0; j < _objDialogs[i].handlers.size(); ++j) {
-				if (_objDialogs[i].handlers[j].opcode == 0xFFFE) {
+				if (_objDialogs[i].handlers[j].opcode == kFallback) {
 					if (res)
 						*res = true;
 					return &_objDialogs[i].handlers[j];
@@ -173,7 +175,7 @@ const DialogHandler *BigDialogue::findHandler(uint objId, uint opcode, bool *res
 		}
 	}
 	for (uint i = 0; i < _objDialogs.size(); ++i) {
-		if (_objDialogs[i].objId != 0xFFFE)
+		if (_objDialogs[i].objId != kFallback)
 			continue;
 		for (uint j = 0; j < _objDialogs[i].handlers.size(); ++j) {
 			if (_objDialogs[i].handlers[j].opcode == opcode) {




More information about the Scummvm-git-logs mailing list