[Scummvm-git-logs] scummvm master -> 6e9232761f971543dfdcd00b0e2bb58d86f4f0e5

Strangerke noreply at scummvm.org
Mon Feb 6 08:11:11 UTC 2023


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

Summary:
6e9232761f EFH: Fix an accidental fall through pointed by digital, remove a useless check


Commit: 6e9232761f971543dfdcd00b0e2bb58d86f4f0e5
    https://github.com/scummvm/scummvm/commit/6e9232761f971543dfdcd00b0e2bb58d86f4f0e5
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2023-02-06T09:11:03+01:00

Commit Message:
EFH: Fix an accidental fall through pointed by digital, remove a useless check

Changed paths:
    engines/efh/fight.cpp
    engines/efh/init.cpp
    engines/efh/script.cpp


diff --git a/engines/efh/fight.cpp b/engines/efh/fight.cpp
index 5c591442758..eee2174f940 100644
--- a/engines/efh/fight.cpp
+++ b/engines/efh/fight.cpp
@@ -1495,11 +1495,11 @@ bool EfhEngine::checkSpecialItemsOnCurrentPlace(int16 itemId) {
 	case 1:
 		if ((itemId >= 0x58 && itemId <= 0x68) || (itemId >= 0x86 && itemId <= 0x89) || (itemId >= 0x74 && itemId <= 0x76) || itemId == 0x8C)
 			retVal = false;
-		// fall through
-		// FIXME: Is this intentional?
+		break;
 	case 2:
 		if ((itemId >= 0x61 && itemId <= 0x63) || (itemId >= 0x74 && itemId <= 0x76) || (itemId >= 0x86 && itemId <= 0x89) || itemId == 0x5B || itemId == 0x5E || itemId == 0x66 || itemId == 0x68 || itemId == 0x8C)
 			retVal = false;
+		break;
 	default:
 		break;
 	}
diff --git a/engines/efh/init.cpp b/engines/efh/init.cpp
index b7511a1da81..47bb4409b34 100644
--- a/engines/efh/init.cpp
+++ b/engines/efh/init.cpp
@@ -371,23 +371,23 @@ EfhEngine::EfhEngine(OSystem *syst, const ADGameDescription *gd) : Engine(syst),
 	memset(_places, 0, ARRAYSIZE(_places));
 	for (int i = 0; i < 24; ++i)
 		memset(_curPlace[i], 0, ARRAYSIZE(_curPlace[i]));
-	memset(_npcBuf, 0, ARRAYSIZE(_npcBuf)*sizeof(NPCStruct));
+	memset(_npcBuf, 0, ARRAYSIZE(_npcBuf) * sizeof(NPCStruct));
 	memset(_imp1, 0, ARRAYSIZE(_imp1));
 	memset(_imp2, 0, ARRAYSIZE(_imp2));
 	memset(_titleSong, 0, ARRAYSIZE(_titleSong));
-	memset(_items, 0, ARRAYSIZE(_items)*sizeof(ItemStruct));
-	memset(_tileFact, 0, ARRAYSIZE(_tileFact)*sizeof(TileFactStruct));
-	memset(_animInfo, 0, ARRAYSIZE(_animInfo)*sizeof(AnimInfo));
+	memset(_items, 0, ARRAYSIZE(_items) * sizeof(ItemStruct));
+	memset(_tileFact, 0, ARRAYSIZE(_tileFact) * sizeof(TileFactStruct));
+	memset(_animInfo, 0, ARRAYSIZE(_animInfo) * sizeof(AnimInfo));
 	memset(_history, 0, ARRAYSIZE(_history));
 	for (int i = 0; i < 19; ++i) {
 		memset(_techDataArr[i], 0, ARRAYSIZE(_techDataArr[i]));
 		memset(_mapArr[i], 0, ARRAYSIZE(_mapArr[i]));
-		memset(_mapMonsters[i], 0, ARRAYSIZE(_mapMonsters[i])*sizeof(MapMonster));
+		memset(_mapMonsters[i], 0, ARRAYSIZE(_mapMonsters[i]) * sizeof(MapMonster));
 		for (int j = 0; j < 64; ++j) {
 			memset(_mapGameMaps[i][j], 0, ARRAYSIZE(_mapGameMaps[i][j]));
 		}
 	}
-	memset(_tileBankSubFilesArray, 0, ARRAYSIZE(_tileBankSubFilesArray)*sizeof(uint8 *));
+	memset(_tileBankSubFilesArray, 0, ARRAYSIZE(_tileBankSubFilesArray) * sizeof(uint8 *));
 	_regenCounter = 0;
 
 	// If requested, load a savegame instead of showing the intro
diff --git a/engines/efh/script.cpp b/engines/efh/script.cpp
index 1495d9e9c23..93f20ecf09e 100644
--- a/engines/efh/script.cpp
+++ b/engines/efh/script.cpp
@@ -351,13 +351,10 @@ int16 EfhEngine::script_parse(Common::String stringBuffer, int16 posX, int16 pos
 			buffer = script_readNumberArray(buffer, 1, scriptNumberArray);
 			if (scriptExecuteFlag) {
 				int16 scriptNpcId = scriptNumberArray[0];
-				// TODO: This "if" is useless, it's doing just the same loop and if statement. Consider removing it.
-				if (isNpcATeamMember(scriptNpcId)) {
-					for (uint counter = 0; counter < 3; ++counter) {
-						if (_teamChar[counter]._id == scriptNpcId) {
-							removeCharacterFromTeam(counter);
-							break;
-						}
+				for (uint counter = 0; counter < 3; ++counter) {
+					if (_teamChar[counter]._id == scriptNpcId) {
+						removeCharacterFromTeam(counter);
+						break;
 					}
 				}
 			}




More information about the Scummvm-git-logs mailing list