[Scummvm-git-logs] scummvm master -> 75d4ccb0c2dcec21b62aebb29921cdc5b2736e79

bluegr noreply at scummvm.org
Sun Jun 14 10:03:33 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:
75d4ccb0c2 NANCY: Implement new functionality for percentage values in ValueTest


Commit: 75d4ccb0c2dcec21b62aebb29921cdc5b2736e79
    https://github.com/scummvm/scummvm/commit/75d4ccb0c2dcec21b62aebb29921cdc5b2736e79
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-06-14T13:03:26+03:00

Commit Message:
NANCY: Implement new functionality for percentage values in ValueTest

Fixes the feed bin gauge and puzzle in Nancy 10

Changed paths:
    engines/nancy/action/datarecords.cpp


diff --git a/engines/nancy/action/datarecords.cpp b/engines/nancy/action/datarecords.cpp
index 500ab2797af..fec5fbc1676 100644
--- a/engines/nancy/action/datarecords.cpp
+++ b/engines/nancy/action/datarecords.cpp
@@ -216,11 +216,14 @@ static const byte kTestAllSingle			= 1;
 static const byte kTestSome					= 2;
 static const byte kTestActualValue			= 3;
 
-static const byte kTestEqualTo				= 0;
-static const byte kTestLessThan				= 1;
-static const byte kTestGreaterThan			= 2;
-static const byte kTestGreaterThanOrEqual	= 3;
-static const byte kTestLessThanOrEqual		= 4;
+static const byte kTestEqualTo                      = 0;
+static const byte kTestLessThan                     = 1;
+static const byte kTestGreaterThan                  = 2;
+static const byte kTestGreaterThanOrEqual           = 3;
+static const byte kTestLessThanOrEqual              = 4;
+static const byte kTestPercentEqualTo               = 5;
+static const byte kTestPercentGreaterThanOrEqual    = 6;
+static const byte kTestPercentLessThanOrEqual       = 7;
 
 void ValueTest::execute() {
 	TableData *playerTable = (TableData *)NancySceneState.getPuzzleData(TableData::getTag());
@@ -262,6 +265,7 @@ void ValueTest::execute() {
 	}
 
 	bool satisfied = false;
+
 	for (uint i = 0; i < testedIndices.size(); ++i) {
 		if (testedIndices[i] == kNoTableIndex) {
 			continue;
@@ -270,6 +274,8 @@ void ValueTest::execute() {
 		float otherValue = 0;
 		if (_testType == kTestActualValue) {
 			otherValue = testedIndices[i];
+			if (_condition >= kTestPercentEqualTo)
+				otherValue = ((float)_indicesToTest[0] * (float)_indicesToTest[1]) / 100.0f;
 		} else {
 			if (testedIndices[i] < numSingleValues) {
 				// Test against single value
@@ -286,34 +292,22 @@ void ValueTest::execute() {
 
 		switch (_condition) {
 		case kTestEqualTo:
-			if (testedValue == otherValue) {
-				satisfied = true;
-			}
-
+		case kTestPercentEqualTo:
+			satisfied = (testedValue == otherValue);
 			break;
 		case kTestLessThan:
-			if (testedValue < otherValue) {
-				satisfied = true;
-			}
-
+			satisfied = (testedValue < otherValue);
 			break;
 		case kTestGreaterThan:
-			if (testedValue > otherValue) {
-				satisfied = true;
-			}
-
+			satisfied = (testedValue > otherValue);
 			break;
 		case kTestGreaterThanOrEqual:
-			if (testedValue >= otherValue) {
-				satisfied = true;
-			}
-
+		case kTestPercentGreaterThanOrEqual:
+			satisfied = (testedValue >= otherValue);
 			break;
 		case kTestLessThanOrEqual:
-			if (testedValue <= otherValue) {
-				satisfied = true;
-			}
-
+		case kTestPercentLessThanOrEqual:
+			satisfied = (testedValue <= otherValue);
 			break;
 		}
 




More information about the Scummvm-git-logs mailing list