[Scummvm-git-logs] scummvm master -> 0dd4345e41e8ef6cab99055ac08a42794dfa4032
Strangerke
noreply at scummvm.org
Wed Jan 15 08:08:58 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:
0dd4345e41 GOT: Refactor use_shield to remove a useless flag (PVS-Studio V547)
Commit: 0dd4345e41e8ef6cab99055ac08a42794dfa4032
https://github.com/scummvm/scummvm/commit/0dd4345e41e8ef6cab99055ac08a42794dfa4032
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-15T09:08:52+01:00
Commit Message:
GOT: Refactor use_shield to remove a useless flag (PVS-Studio V547)
Changed paths:
engines/got/game/move_patterns.cpp
engines/got/game/object.cpp
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index ef1081340b8..2249c4b6b46 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -2473,7 +2473,6 @@ int movement_forty(ACTOR *actr) {
const int x1 = actr->x;
int d = actr->last_dir;
- int f = 1;
if (actr->last_dir == 2) {
if (bgtile(x1 - 2, actr->y) >= TILE_SOLID) {
_G(actor[a].x) -= 2;
diff --git a/engines/got/game/object.cpp b/engines/got/game/object.cpp
index f3fc9ca6d06..74db95b8b8c 100644
--- a/engines/got/game/object.cpp
+++ b/engines/got/game/object.cpp
@@ -285,8 +285,6 @@ int use_boots(int flag) {
}
int use_shield(int flag) {
- bool f = false;
-
if (flag) {
if (_G(thor_info).magic) {
if (!_G(shield_on)) {
@@ -305,21 +303,15 @@ int use_shield(int flag) {
}
return 1;
-
}
- f = true;
not_enough_magic();
- } else {
- f = true;
}
- if (f) {
- if (_G(shield_on)) {
- _G(actor[2]).dead = 2;
- _G(actor[2]).used = 0;
- _G(shield_on) = false;
- }
+ if (_G(shield_on)) {
+ _G(actor[2]).dead = 2;
+ _G(actor[2]).used = 0;
+ _G(shield_on) = false;
}
return 0;
More information about the Scummvm-git-logs
mailing list