[Scummvm-git-logs] scummvm master -> 42aa1cc16323837aafb0f9e367ee92afbe717edc
dreammaster
dreammaster at scummvm.org
Thu Jan 11 04:13:54 CET 2018
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:
9aa9cb4997 XEEN: Fix spelling mistake in array name
42aa1cc163 XEEN: Fix crash after monster ranged attacks finish
Commit: 9aa9cb49977c14ac9527e82f0449071cfc7cf799
https://github.com/scummvm/scummvm/commit/9aa9cb49977c14ac9527e82f0449071cfc7cf799
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-01-10T21:33:36-05:00
Commit Message:
XEEN: Fix spelling mistake in array name
Changed paths:
engines/xeen/interface_scene.cpp
engines/xeen/resources.cpp
engines/xeen/resources.h
diff --git a/engines/xeen/interface_scene.cpp b/engines/xeen/interface_scene.cpp
index 710b34d..f602792 100644
--- a/engines/xeen/interface_scene.cpp
+++ b/engines/xeen/interface_scene.cpp
@@ -433,7 +433,7 @@ void InterfaceScene::drawOutdoorsScene() {
Map &map = *_vm->_map;
for (int idx = 0; idx < 44; ++idx)
- _outdoorList[Res.OUTDOOR_DRAWSTRCT_INDEXES[idx]]._frame = -1;
+ _outdoorList[Res.OUTDOOR_DRAWSTRUCT_INDEXES[idx]]._frame = -1;
if (combat._monstersAttacking) {
for (int idx = 0; idx < 8; ++idx) {
diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp
index f9b6548..0ef55dc 100644
--- a/engines/xeen/resources.cpp
+++ b/engines/xeen/resources.cpp
@@ -721,7 +721,7 @@ const int Resources::MAKE_ITEM_ARR5[8][2] = {
{ 51, 60 }, { 61, 73 }, { 61, 73 }
};
-const int Resources::OUTDOOR_DRAWSTRCT_INDEXES[44] = {
+const int Resources::OUTDOOR_DRAWSTRUCT_INDEXES[44] = {
37, 38, 39, 40, 41, 44, 42, 43, 47, 45, 46,
48, 49, 52, 50, 51, 66, 67, 68, 69, 70, 71,
72, 75, 73, 74, 87, 88, 89, 90, 91, 94, 92,
diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h
index 6158159..9bde8da 100644
--- a/engines/xeen/resources.h
+++ b/engines/xeen/resources.h
@@ -122,7 +122,7 @@ public:
static const int MAKE_ITEM_ARR3[10][7][2];
static const int MAKE_ITEM_ARR4[2][7][2];
static const int MAKE_ITEM_ARR5[8][2];
- static const int OUTDOOR_DRAWSTRCT_INDEXES[44];
+ static const int OUTDOOR_DRAWSTRUCT_INDEXES[44];
static const int TOWN_MAXES[2][11];
static const char *const TOWN_ACTION_MUSIC[2][7];
static const char *const TOWN_ACTION_SHAPES[7];
Commit: 42aa1cc16323837aafb0f9e367ee92afbe717edc
https://github.com/scummvm/scummvm/commit/42aa1cc16323837aafb0f9e367ee92afbe717edc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-01-10T22:13:43-05:00
Commit Message:
XEEN: Fix crash after monster ranged attacks finish
Changed paths:
engines/xeen/combat.cpp
engines/xeen/combat.h
engines/xeen/interface.cpp
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 43e6d20..cc42c9d 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -131,6 +131,10 @@ void Combat::clear() {
Common::fill(&_attackMonsters[0], &_attackMonsters[ATTACK_MONSTERS_COUNT], -1);
}
+void Combat::clearBlocked() {
+ Common::fill(_charsBlocked, _charsBlocked + PARTY_AND_MONSTERS, false);
+}
+
void Combat::giveCharDamage(int damage, DamageType attackType, int charIndex) {
Party &party = *_vm->_party;
Scripts &scripts = *_vm->_scripts;
@@ -773,7 +777,7 @@ void Combat::doMonsterTurn(int monsterId) {
Party &party = *_vm->_party;
Sound &sound = *_vm->_sound;
- if (_monstersAttacking) {
+ if (!_monstersAttacking) {
int monsterIndex;
switch (_whosTurn - _combatParty.size()) {
case 0:
@@ -790,6 +794,7 @@ void Combat::doMonsterTurn(int monsterId) {
intf._indoorList[153]._scale = 0;
}
+ assert(monsterIndex != -1);
MazeMonster &monster = map._mobData._monsters[monsterIndex];
MonsterStruct &monsterData = *monster._monsterData;
if (monster._damageType)
diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h
index f3eaa39..11c1f1d 100644
--- a/engines/xeen/combat.h
+++ b/engines/xeen/combat.h
@@ -104,7 +104,7 @@ private:
void giveExperience(int experience);
public:
Common::Array<Character *> _combatParty;
- Common::Array<bool> _charsBlocked;
+ bool _charsBlocked[PARTY_AND_MONSTERS];
Common::Array<int> _charsGone;
SpriteResource _powSprites;
int _attackMonsters[ATTACK_MONSTERS_COUNT];
@@ -145,8 +145,16 @@ public:
public:
Combat(XeenEngine *vm);
+ /**
+ * Clear the list of attacking monsters
+ */
void clear();
+ /**
+ * Clear the list of blocked characters
+ */
+ void clearBlocked();
+
void giveCharDamage(int damage, DamageType attackType, int charIndex);
/**
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 0cc509a..b9f1e2b 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -1497,7 +1497,7 @@ void Interface::doCombat() {
combat._combatParty.clear();
combat._charsGone.clear();
- combat._charsBlocked.clear();
+ combat.clearBlocked();
combat._charsArray1[0] = 0;
combat._charsArray1[1] = 0;
combat._charsArray1[2] = 0;
@@ -1510,7 +1510,6 @@ void Interface::doCombat() {
// Initialize arrays for character/monster states
combat._charsGone.resize(combat._speedTable.size());
- combat._charsBlocked.resize(combat._speedTable.size());
Common::fill(&combat._charsGone[0], &combat._charsGone[0] + combat._speedTable.size(), 0);
Common::fill(&combat._charsBlocked[0], &combat._charsBlocked[0] + combat._speedTable.size(), false);
@@ -1691,7 +1690,7 @@ void Interface::doCombat() {
// Handling for if the combat turn is complete
if (combat.allHaveGone()) {
Common::fill(&combat._charsGone[0], &combat._charsGone[0] + combat._charsGone.size(), false);
- Common::fill(&combat._charsBlocked[0], &combat._charsBlocked[0] + combat._charsBlocked.size(), false);
+ combat.clearBlocked();
combat.setSpeedTable();
combat._whosTurn = -1;
combat._whosSpeed = -1;
More information about the Scummvm-git-logs
mailing list