aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kohaut2018-03-17 17:07:51 +0100
committerPeter Kohaut2018-03-17 17:07:51 +0100
commit5b50bad5e95808052048b9e5cd58cacc8c0dfac2 (patch)
treedc82de51da7c7d21dae2f30b78df738395d1bbd3
parent19d9e4cec818980a75772a204c96774afbd2b17e (diff)
downloadscummvm-rg350-5b50bad5e95808052048b9e5cd58cacc8c0dfac2.tar.gz
scummvm-rg350-5b50bad5e95808052048b9e5cd58cacc8c0dfac2.tar.bz2
scummvm-rg350-5b50bad5e95808052048b9e5cd58cacc8c0dfac2.zip
BLADERUNNER: Fixed compilation warnings
-rw-r--r--engines/bladerunner/actor.cpp10
-rw-r--r--engines/bladerunner/actor.h2
-rw-r--r--engines/bladerunner/actor_combat.cpp18
-rw-r--r--engines/bladerunner/actor_combat.h4
-rw-r--r--engines/bladerunner/script/script.cpp4
-rw-r--r--engines/bladerunner/script/script.h2
6 files changed, 19 insertions, 21 deletions
diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp
index 177734fe37..b45e6e2114 100644
--- a/engines/bladerunner/actor.cpp
+++ b/engines/bladerunner/actor.cpp
@@ -978,18 +978,17 @@ void Actor::modifyMaxHP(signed int change) {
}
-void Actor::combatModeOn(int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool a14) {
+void Actor::combatModeOn(int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool unstoppable) {
_animationModeCombatIdle = animationModeCombatIdle;
_animationModeCombatWalk = animationModeCombatWalk;
_animationModeCombatRun = animationModeCombatRun;
_inCombat = true;
if (_id != kActorMcCoy) {
- _combatInfo->combatOn(_id, initialState, rangedAttack, enemyId, waypointType, fleeRatio, coverRatio, actionRatio, damage, range, a14);
+ _combatInfo->combatOn(_id, initialState, rangedAttack, enemyId, waypointType, fleeRatio, coverRatio, actionRatio, damage, range, unstoppable);
}
stopWalking(false);
changeAnimationMode(_animationModeCombatIdle, false);
- int i;
- for (i = 0; i < (int)_vm->_gameInfo->getActorCount(); i++) {
+ for (int i = 0; i < (int)_vm->_gameInfo->getActorCount(); i++) {
Actor *otherActor = _vm->_actors[i];
if (i != _id && otherActor->_setId == _setId && !otherActor->_isRetired) {
_vm->_aiScripts->otherAgentEnteredCombatMode(i, _id, true);
@@ -1004,8 +1003,7 @@ void Actor::combatModeOff() {
_inCombat = false;
stopWalking(false);
changeAnimationMode(kAnimationModeIdle, false);
- int i;
- for (i = 0; i < (int)_vm->_gameInfo->getActorCount(); i++) {
+ for (int i = 0; i < (int)_vm->_gameInfo->getActorCount(); i++) {
Actor *otherActor = _vm->_actors[i];
if (i != _id && otherActor->_setId == _setId && !otherActor->_isRetired) {
_vm->_aiScripts->otherAgentEnteredCombatMode(i, _id, false);
diff --git a/engines/bladerunner/actor.h b/engines/bladerunner/actor.h
index ace90554b7..f074b55314 100644
--- a/engines/bladerunner/actor.h
+++ b/engines/bladerunner/actor.h
@@ -222,7 +222,7 @@ public:
void retire(bool isRetired, int width, int height, int retiredByActorId);
- void combatModeOn(int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool a14);
+ void combatModeOn(int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool unstoppable);
void combatModeOff();
void setGoal(int goalNumber);
diff --git a/engines/bladerunner/actor_combat.cpp b/engines/bladerunner/actor_combat.cpp
index 47d1c2d3a0..aa8e55b28c 100644
--- a/engines/bladerunner/actor_combat.cpp
+++ b/engines/bladerunner/actor_combat.cpp
@@ -49,10 +49,10 @@ void ActorCombat::setup() {
reset();
}
-void ActorCombat::combatOn(int actorId, int initialState, bool rangedAttack, int enemyId, int waypointType, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool a12) {
+void ActorCombat::combatOn(int actorId, int initialState, bool rangedAttackFlag, int enemyId, int waypointType, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool unstoppable) {
_actorId = actorId;
_state = initialState;
- _rangedAttack = rangedAttack;
+ _rangedAttack = rangedAttackFlag;
_enemyId = enemyId;
_waypointType = waypointType;
_damage = damage;
@@ -63,12 +63,12 @@ void ActorCombat::combatOn(int actorId, int initialState, bool rangedAttack, int
_coverRatio = coverRatio;
_actionRatio = actionRatio;
_active = true;
- if (rangedAttack == 1) {
+ if (_rangedAttack) {
_range = range;
} else {
_range = 300;
}
- field_3C = a12;
+ _unstoppable = unstoppable;
Actor *actor = _vm->_actors[_actorId];
@@ -227,7 +227,7 @@ void ActorCombat::hitAttempt() {
Actor *actor = _vm->_actors[_actorId];
Actor *enemy = _vm->_actors[_enemyId];
- if (_enemyId == kActorMcCoy && !_vm->playerHasControl() && field_3C == 0) {
+ if (_enemyId == kActorMcCoy && !_vm->playerHasControl() && !_unstoppable) {
return;
}
@@ -306,7 +306,7 @@ void ActorCombat::reset() {
_actionRatioConst = -1;
_actorHp = 0;
_range = 300;
- field_3C = 0;
+ _unstoppable = false;
_actorPosition = Vector3(0.0f, 0.0f, 0.0f);
_enemyPosition = Vector3(0.0f, 0.0f, 0.0f);
_coversWaypointCount = 0;
@@ -417,7 +417,7 @@ void ActorCombat::rangedAttack() {
} else {
faceEnemy();
if (actor->getAnimationMode() != kAnimationModeCombatAttack) {
- if (_enemyId != kActorMcCoy || _vm->playerHasControl() || field_3C != 0) {
+ if (_enemyId != kActorMcCoy || _vm->playerHasControl() || _unstoppable) {
actor->changeAnimationMode(kAnimationModeCombatAttack, false);
}
}
@@ -432,7 +432,7 @@ void ActorCombat::closeAttack() {
} else {
faceEnemy();
if (actor->getAnimationMode() != kAnimationModeCombatAttack) {
- if (_enemyId != kActorMcCoy || _vm->playerHasControl() || field_3C != 0) {
+ if (_enemyId != kActorMcCoy || _vm->playerHasControl() || _unstoppable) {
actor->changeAnimationMode(kAnimationModeCombatAttack, false);
}
}
@@ -504,7 +504,7 @@ int ActorCombat::getaggressivenessRangedAttack() const {
return 0;
}
- float distance = MIN(actor->distanceFromActor(_enemyId), 900.0f);
+ int distance = MIN(actor->distanceFromActor(_enemyId), 900.0f);
int aggressiveness = 0;
if (enemy->isRunning()) {
diff --git a/engines/bladerunner/actor_combat.h b/engines/bladerunner/actor_combat.h
index 2c6ea8ac8e..42ef7de9a6 100644
--- a/engines/bladerunner/actor_combat.h
+++ b/engines/bladerunner/actor_combat.h
@@ -47,7 +47,7 @@ class ActorCombat {
int _actionRatioConst;
int _actorHp;
int _range;
- int field_3C;
+ bool _unstoppable;
Vector3 _actorPosition;
Vector3 _enemyPosition;
int _coversWaypointCount;
@@ -60,7 +60,7 @@ public:
void setup();
- void combatOn(int actorId, int initialState, bool rangedAttack, int enemyId, int waypointType, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool a12);
+ void combatOn(int actorId, int initialState, bool rangedAttack, int enemyId, int waypointType, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool unstoppable);
void combatOff();
void tick();
diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp
index ff2a840a28..fc595bc3de 100644
--- a/engines/bladerunner/script/script.cpp
+++ b/engines/bladerunner/script/script.cpp
@@ -218,8 +218,8 @@ void ScriptBase::Actor_Combat_AI_Hit_Attempt(int actorId) {
_vm->_actors[actorId]->_combatInfo->hitAttempt();
}
-void ScriptBase::Non_Player_Actor_Combat_Mode_On(int actorId, int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool a14) {
- _vm->_actors[actorId]->combatModeOn(initialState, rangedAttack, enemyId, waypointType, animationModeCombatIdle, animationModeCombatWalk, animationModeCombatRun, fleeRatio, coverRatio, actionRatio, damage, range, a14);
+void ScriptBase::Non_Player_Actor_Combat_Mode_On(int actorId, int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool unstoppable) {
+ _vm->_actors[actorId]->combatModeOn(initialState, rangedAttack, enemyId, waypointType, animationModeCombatIdle, animationModeCombatWalk, animationModeCombatRun, fleeRatio, coverRatio, actionRatio, damage, range, unstoppable);
}
void ScriptBase::Non_Player_Actor_Combat_Mode_Off(int actorId) {
diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h
index 9df231a1c3..3940c457bc 100644
--- a/engines/bladerunner/script/script.h
+++ b/engines/bladerunner/script/script.h
@@ -78,7 +78,7 @@ protected:
void Actor_Set_Flag_Damage_Anim_If_Moving(int actorId, bool value);
bool Actor_Query_Flag_Damage_Anim_If_Moving(int actorId);
void Actor_Combat_AI_Hit_Attempt(int actorId);
- void Non_Player_Actor_Combat_Mode_On(int actorId, int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool a14);
+ void Non_Player_Actor_Combat_Mode_On(int actorId, int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool unstoppable);
void Non_Player_Actor_Combat_Mode_Off(int actorId);
void Actor_Set_Health(int actorId, int hp, int maxHp);
void Actor_Set_Targetable(int actorId, bool targetable);