aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen
diff options
context:
space:
mode:
authorPaul Gilbert2015-01-18 17:17:55 -0500
committerPaul Gilbert2015-01-18 17:17:55 -0500
commit9925453774c803921f5ed3503bbd448b1888f011 (patch)
treee0fc1fb05cae5447d976e57cd581a28bfe5c9e2d /engines/xeen
parentceeda17ab1fae75e28c4d15e3e829a02615ffc81 (diff)
downloadscummvm-rg350-9925453774c803921f5ed3503bbd448b1888f011.tar.gz
scummvm-rg350-9925453774c803921f5ed3503bbd448b1888f011.tar.bz2
scummvm-rg350-9925453774c803921f5ed3503bbd448b1888f011.zip
XEEN: Fix loading of MonsterData array
Diffstat (limited to 'engines/xeen')
-rw-r--r--engines/xeen/map.cpp21
-rw-r--r--engines/xeen/map.h2
2 files changed, 14 insertions, 9 deletions
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 10143edec3..36232aeb91 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -94,13 +94,18 @@ MonsterStruct::MonsterStruct(Common::String name, int experience, int hp, int ac
void MonsterStruct::synchronize(Common::SeekableReadStream &s) {
- _experience = s.readByte();
- _hp = s.readByte();
+ char name[16];
+ s.read(name, 16);
+ name[15] = '\0';
+ _name = Common::String(name);
+
+ _experience = s.readUint32LE();
+ _hp = s.readUint16LE();
_accuracy = s.readByte();
_speed = s.readByte();
_numberOfAttacks = s.readByte();
- _hatesClass = CLASS_KNIGHT;
- _strikes = s.readByte();
+ _hatesClass = (CharacterClass)s.readByte();
+ _strikes = s.readUint16LE();
_dmgPerStrike = s.readByte();
_attackType = (DamageType)s.readByte();
_specialAttack = (SpecialAttack)s.readByte();
@@ -115,18 +120,18 @@ void MonsterStruct::synchronize(Common::SeekableReadStream &s) {
_magicResistence = s.readByte();
_phsyicalResistence = s.readByte();
_field29 = s.readByte();
- _gold = s.readByte();
+ _gold = s.readUint16LE();
_gems = s.readByte();
_itemDrop = s.readByte();
- _flying = s.readByte();
+ _flying = s.readByte() != 0;
_imageNumber = s.readByte();
_loopAnimation = s.readByte();
_animationEffect = s.readByte();
_field32 = s.readByte();
- char attackVoc[9];
+ char attackVoc[10];
s.read(attackVoc, 9);
- attackVoc[8] = '\0';
+ attackVoc[9] = '\0';
_attackVoc = Common::String(attackVoc);
}
diff --git a/engines/xeen/map.h b/engines/xeen/map.h
index 5c3e5a3fed..ec9604c849 100644
--- a/engines/xeen/map.h
+++ b/engines/xeen/map.h
@@ -89,7 +89,7 @@ public:
int _gold;
int _gems;
int _itemDrop;
- int _flying;
+ bool _flying;
int _imageNumber;
int _loopAnimation;
int _animationEffect;