[Scummvm-git-logs] scummvm master -> 9628f7f9f9224819bca58c68eabf56824a9fc70f

Strangerke noreply at scummvm.org
Sat Jan 25 07:50:03 UTC 2025


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:
9628f7f9f9 GOT: Remove another useless variable, renaming


Commit: 9628f7f9f9224819bca58c68eabf56824a9fc70f
    https://github.com/scummvm/scummvm/commit/9628f7f9f9224819bca58c68eabf56824a9fc70f
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-25T08:49:54+01:00

Commit Message:
GOT: Remove another useless variable, renaming

Changed paths:
    engines/got/game/boss2.cpp
    engines/got/game/main.cpp
    engines/got/game/move.cpp
    engines/got/game/move_patterns.cpp
    engines/got/game/object.cpp
    engines/got/game/script.cpp
    engines/got/game/special_tile.cpp
    engines/got/got.cpp
    engines/got/vars.h
    engines/got/views/game_content.cpp


diff --git a/engines/got/game/boss2.cpp b/engines/got/game/boss2.cpp
index 9f19a677df5..751382269b5 100644
--- a/engines/got/game/boss2.cpp
+++ b/engines/got/game/boss2.cpp
@@ -222,7 +222,7 @@ void boss2SetupLevel() {
 }
 
 static int boss2Die() {
-	_G(thunder_flag) = 0;
+	_G(thunderSnakeCounter) = 0;
 	if (_G(boss_dead)) {
 		for (int rep = 0; rep < 4; rep++) {
 			const int x1 = _G(actor[3 + rep])._lastX[_G(pge)];
@@ -320,7 +320,7 @@ static int boss2MovementShake(Actor *actor) {
 	if (actor->_i4) {
 		actor->_i4--;
 		if (!actor->_i4)
-			_G(thunder_flag) = 0;
+			_G(thunderSnakeCounter) = 0;
 	}
 	if (!actor->_i2) {
 		if (actor->_x < 144)
@@ -346,7 +346,7 @@ static int boss2MovementShake(Actor *actor) {
 		actor->_x += 2;
 
 	if (actor->_x < 20 || actor->_x > 270) {
-		_G(thunder_flag) = 100;
+		_G(thunderSnakeCounter) = 100;
 		actor->_i4 = 50;
 		playSound(EXPLODE, true);
 		actor->_i2 = 0;
diff --git a/engines/got/game/main.cpp b/engines/got/game/main.cpp
index a2c4c19650f..22f3a79caec 100644
--- a/engines/got/game/main.cpp
+++ b/engines/got/game/main.cpp
@@ -54,8 +54,7 @@ void setupLoad() {
 	_G(thor)->_show = 60;
 	_G(apple_flag) = false;
 	_G(bomb_flag) = false;
-	_G(thunder_flag) = 0;
-	_G(lightning_used) = false;
+	_G(thunderSnakeCounter) = 0;
 	_G(tornado_used) = false;
 	_G(shield_on) = false;
 	_G(actor[1])._active = false;
diff --git a/engines/got/game/move.cpp b/engines/got/game/move.cpp
index d359e7b93bd..e2764b1ab33 100644
--- a/engines/got/game/move.cpp
+++ b/engines/got/game/move.cpp
@@ -97,7 +97,7 @@ void thorShoots() {
 }
 
 int killGoodGuy() {
-	if (!_G(killgg_inform) && !_G(thunder_flag)) {
+	if (!_G(killgg_inform) && !_G(thunderSnakeCounter)) {
 		odinSpeaks(2010, 0);
 		_G(killgg_inform) = true;
 	}
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index 3cfc962ae54..9985b8e4741 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -976,7 +976,7 @@ int specialMovementTwo(Actor *actor) {
 
 // Yellow globe
 int specialMovementThree(Actor *actor) {
-	if (_G(thunder_flag))
+	if (_G(thunderSnakeCounter))
 		return 0;
 
 	long lind = (long)_G(current_level);
@@ -1082,7 +1082,7 @@ int specialMovementTen(Actor *actor) {
 		return 0;
 	}
 
-	if (_G(thunder_flag))
+	if (_G(thunderSnakeCounter))
 		return 0;
 
 	actor_ctr = 10;
@@ -1147,7 +1147,6 @@ int movementTwo(Actor *actor) {
 		if (actor->_actorNum == 2) {
 			actor->_active = false;
 			actor->_dead = 2;
-			_G(lightning_used) = false;
 			_G(tornado_used) = false;
 		}
 	}
diff --git a/engines/got/game/object.cpp b/engines/got/game/object.cpp
index 56a9aeaf8fa..3070ea89ed3 100644
--- a/engines/got/game/object.cpp
+++ b/engines/got/game/object.cpp
@@ -138,9 +138,8 @@ void pickUpObject(int p) {
 	case 30:
 	case 31:
 	case 32: {
-		_G(thunder_flag) = 0;
+		_G(thunderSnakeCounter) = 0;
 		_G(shield_on) = false;
-		_G(lightning_used) = false;
 		_G(tornado_used) = false;
 		_G(hammer)->_numMoves = 2;
 		_G(thor)->_numMoves = 1;
@@ -235,18 +234,18 @@ bool useApple(int flag) {
 
 bool useThunder(int flag) {
 	if (flag && _G(thorInfo)._magic > 29) {
-		if (!_G(thunder_flag)) {
+		if (!_G(thunderSnakeCounter)) {
 			addMagic(-30);
 			playSound(THUNDER, false);
-			_G(thunder_flag) = 60;
+			_G(thunderSnakeCounter) = 60;
 		}
 		return true;
 	}
 
-	if (flag && !_G(thunder_flag))
+	if (flag && !_G(thunderSnakeCounter))
 		notEnoughMagic();
 
-	if (_G(thunder_flag))
+	if (_G(thunderSnakeCounter))
 		return true;
 	
 	return false;
diff --git a/engines/got/game/script.cpp b/engines/got/game/script.cpp
index 1c0e05fa149..b1ed99a6b73 100644
--- a/engines/got/game/script.cpp
+++ b/engines/got/game/script.cpp
@@ -1086,7 +1086,7 @@ void Scripts::scr_func3() {
 }
 
 void Scripts::scr_func4() {
-	_G(thunder_flag) = 60;
+	_G(thunderSnakeCounter) = 60;
 }
 
 void Scripts::scr_func5() {
diff --git a/engines/got/game/special_tile.cpp b/engines/got/game/special_tile.cpp
index 3455696d906..315e28dff9b 100644
--- a/engines/got/game/special_tile.cpp
+++ b/engines/got/game/special_tile.cpp
@@ -113,7 +113,7 @@ int specialTileThor(const int x, const int y, const int icon) {
 				actorVisible(4);
 				actorVisible(5);
 				Common::fill(_G(scrn)._actorInvis, _G(scrn)._actorInvis + 16, 0);
-				_G(thunder_flag) = 60;
+				_G(thunderSnakeCounter) = 60;
 				playSound(THUNDER, true);
 				_G(setup).f22 = true;
 			}
diff --git a/engines/got/got.cpp b/engines/got/got.cpp
index 2a5791aa030..99c9fbcfaec 100644
--- a/engines/got/got.cpp
+++ b/engines/got/got.cpp
@@ -227,8 +227,7 @@ void GotEngine::pauseEngineIntern(bool pause) {
 		_G(shield_on) = false;
 	}
 
-	_G(lightning_used) = false;
-	_G(thunder_flag) = 0;
+	_G(thunderSnakeCounter) = 0;
 
 	Engine::pauseEngineIntern(pause);
 }
diff --git a/engines/got/vars.h b/engines/got/vars.h
index 8aec8fd3795..b21f8d33ba3 100644
--- a/engines/got/vars.h
+++ b/engines/got/vars.h
@@ -176,8 +176,7 @@ public:
 
 	int _rand1 = 0;
 	int _rand2 = 0;
-	int _thunder_flag = 0;
-	bool _lightning_used = false;
+	int _thunderSnakeCounter = 0;
 	bool _tornado_used = false;
 	bool _shield_on = false;
 	bool _apple_flag = false;
diff --git a/engines/got/views/game_content.cpp b/engines/got/views/game_content.cpp
index 84b13c0f96f..a376fe66a9f 100644
--- a/engines/got/views/game_content.cpp
+++ b/engines/got/views/game_content.cpp
@@ -299,7 +299,7 @@ void GameContent::drawBossHealth(GfxSurface &s) {
 }
 
 void GameContent::checkThunderShake() {
-	if (_G(thunder_flag)) {
+	if (_G(thunderSnakeCounter)) {
 		_G(gameMode) = MODE_THUNDER;
 
 		// Introduce a random screen shake by rendering screen 1 pixel offset randomly
@@ -310,16 +310,16 @@ void GameContent::checkThunderShake() {
 		_moveDelta.x = DELTA_X[delta];
 		_moveDelta.y = DELTA_Y[delta];
 
-		_G(thunder_flag--);
-		if ((_G(thunder_flag) < MAX_ACTORS) && _G(thunder_flag) > 2) {
-			int thunderFl = _G(thunder_flag);
+		_G(thunderSnakeCounter--);
+		if ((_G(thunderSnakeCounter) < MAX_ACTORS) && _G(thunderSnakeCounter) > 2) {
+			int thunderFl = _G(thunderSnakeCounter);
 			if (_G(actor[thunderFl])._active) {
 				_G(actor[thunderFl])._vulnerableCountdown = 0;
 				actorDamaged(&_G(actor[thunderFl]), 20);
 			}
 		}
 
-		if (!_G(thunder_flag)) {
+		if (!_G(thunderSnakeCounter)) {
 			_G(gameMode) = MODE_NORMAL;
 			_moveDelta = Common::Point(0, 0);
 		}
@@ -542,8 +542,7 @@ void GameContent::thorDead() {
 	_G(thor)->_show = 60;
 	_G(apple_flag) = false;
 	_G(bomb_flag) = false;
-	_G(thunder_flag) = 0;
-	_G(lightning_used) = false;
+	_G(thunderSnakeCounter) = 0;
 	_G(tornado_used) = false;
 	_G(shield_on) = false;
 	musicResume();




More information about the Scummvm-git-logs mailing list