[Scummvm-git-logs] scummvm master -> 5a87012e629aeffac7d7aead09888c5b1b34d0a9

kelmer44 noreply at scummvm.org
Wed May 27 08:58:08 UTC 2026


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

Summary:
5a87012e62 PELROCK: Fix static report on dialog.cpp. PVS-Studio V1048, V581, V560


Commit: 5a87012e629aeffac7d7aead09888c5b1b34d0a9
    https://github.com/scummvm/scummvm/commit/5a87012e629aeffac7d7aead09888c5b1b34d0a9
Author: kelmer (kelmer at gmail.com)
Date: 2026-05-27T10:57:59+02:00

Commit Message:
PELROCK: Fix static report on dialog.cpp. PVS-Studio V1048, V581, V560

Changed paths:
    engines/pelrock/dialog.cpp
    engines/pelrock/resources.cpp


diff --git a/engines/pelrock/dialog.cpp b/engines/pelrock/dialog.cpp
index 312ee25c896..774dc0c5622 100644
--- a/engines/pelrock/dialog.cpp
+++ b/engines/pelrock/dialog.cpp
@@ -354,7 +354,7 @@ int DialogManager::selectChoice(Common::Array<Common::String> &choices, Graphics
 
 			if (_events->_mouseClickY >= overlayY) {
 				int selectedIndex = (_events->_mouseClickY - overlayY - 2) / kChoiceHeight;
-				if (selectedIndex >= 0 && selectedIndex < (int)choices.size()) {
+				if (selectedIndex < (int)choices.size()) {
 					_dialogActive = false;
 					g_engine->_chrono->resumeCounter();
 					return selectedIndex;
@@ -578,9 +578,6 @@ void DialogManager::startConversation(const byte *conversationData, uint32 dataS
 
 		if (!skipToChoices) {
 			state.position = readAndDisplayDialogue(conversationData, dataSize, state.position);
-		}
-
-		if (!skipToChoices) {
 			ConversationEndResult endResult = checkConversationEnd(conversationData, dataSize, state.position, state.currentRoot);
 			// Dispatch action for both 0xF8 (action+end) and 0xEB (action+continue)
 			if (endResult.hasAction) {
@@ -999,7 +996,6 @@ void DialogManager::maybeDisableChoice(Common::Array<Pelrock::ChoiceOption> *cho
 				byte idx = data[scanPos + 1];
 				if (idx == (byte)currentLevel) {
 					currentChoicePos = scanPos;
-					isCurrentFB = true;
 					foundParent = true;
 					break;
 				}
diff --git a/engines/pelrock/resources.cpp b/engines/pelrock/resources.cpp
index 4d6c56d3c6b..c196cb3cb71 100644
--- a/engines/pelrock/resources.cpp
+++ b/engines/pelrock/resources.cpp
@@ -579,7 +579,7 @@ byte *ResourceManager::loadStickerPixels(const Sticker &sticker) {
 InventoryObject ResourceManager::getIconForObject(byte objectIndex) {
 	byte iconIndex = 0;
 	if (objectIndex < 59) {
-		if (objectIndex >= 11 && objectIndex < 59) {
+		if (objectIndex >= 11) {
 			iconIndex = ((objectIndex - 11) & 3) + 11; // Books cycle through icons 11-14
 		} else {
 			iconIndex = objectIndex; // Direct mapping for IDs 0-11




More information about the Scummvm-git-logs mailing list