[Scummvm-git-logs] scummvm master -> 6205a5d4fe6e900f124c3f778aa75bb87c65bc89

digitall noreply at scummvm.org
Wed Jan 12 03:45:28 UTC 2022


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:
6205a5d4fe ULTIMA4: Minor Improvement in Temporary Variable Scope


Commit: 6205a5d4fe6e900f124c3f778aa75bb87c65bc89
    https://github.com/scummvm/scummvm/commit/6205a5d4fe6e900f124c3f778aa75bb87c65bc89
Author: D G Turner (digitall at scummvm.org)
Date: 2022-01-12T03:43:55Z

Commit Message:
ULTIMA4: Minor Improvement in Temporary Variable Scope

Changed paths:
    engines/ultima/ultima4/game/item.cpp


diff --git a/engines/ultima/ultima4/game/item.cpp b/engines/ultima/ultima4/game/item.cpp
index 59afbf6d1a6..9294601eaa9 100644
--- a/engines/ultima/ultima4/game/item.cpp
+++ b/engines/ultima/ultima4/game/item.cpp
@@ -671,14 +671,12 @@ void Items::putReagentInInventory(int reag) {
 }
 
 bool Items::itemConditionsMet(byte conditions) {
-	int i;
-
 	if ((conditions & SC_NEWMOONS) &&
 	        !(g_ultima->_saveGame->_trammelPhase == 0 && g_ultima->_saveGame->_feluccaPhase == 0))
 		return false;
 
 	if (conditions & SC_FULLAVATAR) {
-		for (i = 0; i < VIRT_MAX; i++) {
+		for (int i = 0; i < VIRT_MAX; i++) {
 			if (g_ultima->_saveGame->_karma[i] != 0)
 				return false;
 		}
@@ -692,8 +690,7 @@ bool Items::itemConditionsMet(byte conditions) {
 }
 
 const ItemLocation *Items::itemAtLocation(const Map *map, const Coords &coords) {
-	uint i;
-	for (i = 0; i < N_ITEMS; i++) {
+	for (uint i = 0; i < N_ITEMS; i++) {
 		if (!ITEMS[i]._locationLabel)
 			continue;
 		if (map->getLabel(ITEMS[i]._locationLabel) == coords &&
@@ -704,10 +701,9 @@ const ItemLocation *Items::itemAtLocation(const Map *map, const Coords &coords)
 }
 
 void Items::itemUse(const Common::String &shortName) {
-	uint i;
 	const ItemLocation *item = nullptr;
 
-	for (i = 0; i < N_ITEMS; i++) {
+	for (uint i = 0; i < N_ITEMS; i++) {
 		if (ITEMS[i]._shortName &&
 		        scumm_stricmp(ITEMS[i]._shortName, shortName.c_str()) == 0) {
 




More information about the Scummvm-git-logs mailing list