[Scummvm-git-logs] scummvm master -> fd9e6d284391b4ef96f155842f0dbc72cd63be91

mduggan noreply at scummvm.org
Mon Sep 23 07:27:17 UTC 2024


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

Summary:
a8589d81d0 DGDS: Init array to make coverity happy
fd9e6d2843 DGDS: Fix variable mixup identified by coverity


Commit: a8589d81d08911b963e3f4069bc39969b6bc0160
    https://github.com/scummvm/scummvm/commit/a8589d81d08911b963e3f4069bc39969b6bc0160
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-09-23T17:20:12+10:00

Commit Message:
DGDS: Init array to make coverity happy

Changed paths:
    engines/dgds/dragon_arcade_ttm.cpp


diff --git a/engines/dgds/dragon_arcade_ttm.cpp b/engines/dgds/dragon_arcade_ttm.cpp
index e5dc44b4a71..8b3325dd6e0 100644
--- a/engines/dgds/dragon_arcade_ttm.cpp
+++ b/engines/dgds/dragon_arcade_ttm.cpp
@@ -295,7 +295,7 @@ int16 DragonArcadeTTM::runScriptPage(int16 pageNum) {
 
 	uint16 opcode = scr->readUint16LE();
 	while (opcode != 0x0ff0 && opcode) {
-		int16 ivals[4];
+		int16 ivals[4] { 0, 0, 0, 0 };
 		Common::String sval;
 		byte count = (byte)(opcode & 0xf);
 		if (count <= 4) {


Commit: fd9e6d284391b4ef96f155842f0dbc72cd63be91
    https://github.com/scummvm/scummvm/commit/fd9e6d284391b4ef96f155842f0dbc72cd63be91
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-09-23T17:20:32+10:00

Commit Message:
DGDS: Fix variable mixup identified by coverity

Changed paths:
    engines/dgds/dragon_arcade.cpp


diff --git a/engines/dgds/dragon_arcade.cpp b/engines/dgds/dragon_arcade.cpp
index b9482457833..3614519ae5e 100644
--- a/engines/dgds/dragon_arcade.cpp
+++ b/engines/dgds/dragon_arcade.cpp
@@ -1231,12 +1231,12 @@ void DragonArcade::updateBoss() {
 
 	int16 distToBoss = _npcState[1].x - _npcState[0].x;
 	int16 absDistToBoss = abs(distToBoss);
-	bool bossIsClose = absDistToBoss < 20;
+	bool bossIsCloseY = abs(_npcState[1].y - _npcState[0].y) < 20;
 	uint16 randVal = _nextRandomVal % 16;
 
 	switch(_npcState[1].byte12 - 1) {
 	case 0:
-		if (bossIsClose && absDistToBoss < 45) {
+		if (bossIsCloseY && absDistToBoss < 45) {
 			if (_bladeState1 != 8 && _bladeState1 != 9) {
 				_npcState[1].byte12 = 5;
 				_npcState[1].ttmPage = 30;
@@ -1245,7 +1245,7 @@ void DragonArcade::updateBoss() {
 			_npcState[1].byte12 = 3;
 			_npcState[1].ttmPage = 10;
 			_bossStateUpdateCounter++;
-		} else if ((bossIsClose && distToBoss < 70 && 0 < distToBoss && randVal == 15) || (0 < _bossStateUpdateCounter && randVal == 7)) {
+		} else if ((bossIsCloseY && distToBoss < 70 && 0 < distToBoss && randVal == 15) || (0 < _bossStateUpdateCounter && randVal == 7)) {
 			_npcState[1].byte12 = 2;
 			_npcState[1].ttmPage = 3;
 			_bossStateUpdateCounter--;
@@ -1322,7 +1322,7 @@ void DragonArcade::updateBoss() {
 	case 4:
 		if (_npcState[1].ttmPage < 37) {
 			_npcState[1].ttmPage++;
-			if (bossIsClose && absDistToBoss < 50 && _uint0a17 == 0 && 33 < _npcState[1].ttmPage && _npcState[1].ttmPage < 37) {
+			if (bossIsCloseY && absDistToBoss < 50 && _uint0a17 == 0 && 33 < _npcState[1].ttmPage && _npcState[1].ttmPage < 37) {
 				_npcState[0].byte12 = 10;
 				_bladeState1 = 10;
 				_npcState[0].ttmPage = 76;




More information about the Scummvm-git-logs mailing list