mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 01:46:42 +00:00
XEEN: Bugfix for bad mob data, WOXCD top of witches tower
This commit is contained in:
parent
23161b27dc
commit
912b2f03eb
1
NEWS.md
1
NEWS.md
@ -36,6 +36,7 @@ For a more comprehensive changelog of the latest experimental code, see:
|
||||
|
||||
Xeen:
|
||||
- Add missing sprite drawer for enemies hit by Energy Blast.
|
||||
- Fixed freeze due to bad mob data at the top of Witches Tower
|
||||
|
||||
Linux port:
|
||||
- Added option to use the system file browser instead of the ScummVM file browser.
|
||||
|
@ -244,13 +244,18 @@ public:
|
||||
class XeenSerializer : public Common::Serializer {
|
||||
private:
|
||||
Common::SeekableReadStream *_in;
|
||||
int _filesize;
|
||||
public:
|
||||
XeenSerializer(Common::SeekableReadStream *in, Common::WriteStream *out) :
|
||||
Common::Serializer(in, out), _in(in) {}
|
||||
Common::Serializer(in, out), _in(in), _filesize(-1) {}
|
||||
|
||||
SYNC_AS(Sint8, Byte, int8, 1)
|
||||
|
||||
bool finished() const { return _in != nullptr && _in->pos() >= _in->size(); }
|
||||
bool finished() {
|
||||
if (_in && _filesize == -1)
|
||||
_filesize = _in->size();
|
||||
return _in != nullptr && _in->pos() >= _filesize;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -477,6 +477,9 @@ void MonsterObjectData::synchronize(XeenSerializer &s, MonsterData &monsterData)
|
||||
|
||||
_objects.push_back(obj);
|
||||
mobStruct.synchronize(s);
|
||||
if (s.finished())
|
||||
// WORKAROUND: If end of data abnormally reached
|
||||
return;
|
||||
} while (mobStruct._id != 255 || mobStruct._pos.x != -1);
|
||||
|
||||
// Load monsters
|
||||
@ -486,6 +489,10 @@ void MonsterObjectData::synchronize(XeenSerializer &s, MonsterData &monsterData)
|
||||
mobStruct.synchronize(s);
|
||||
|
||||
while (mobStruct._id != 255 || mobStruct._pos.x != -1) {
|
||||
if (s.finished())
|
||||
// WORKAROUND: If end of data abnormally reached
|
||||
return;
|
||||
|
||||
MazeMonster mon;
|
||||
mon._position = mobStruct._pos;
|
||||
mon._id = mobStruct._id;
|
||||
@ -514,6 +521,10 @@ void MonsterObjectData::synchronize(XeenSerializer &s, MonsterData &monsterData)
|
||||
// Load wall items. Unlike the previous two arrays, this has no dummy entry for an empty array
|
||||
mobStruct.synchronize(s);
|
||||
while (mobStruct._id != 255 || mobStruct._pos.x != -1) {
|
||||
if (s.finished())
|
||||
// WORKAROUND: If end of data abnormally reached
|
||||
return;
|
||||
|
||||
if (mobStruct._id < (int)_wallItemSprites.size()) {
|
||||
MazeWallItem wi;
|
||||
wi._position = mobStruct._pos;
|
||||
|
Loading…
x
Reference in New Issue
Block a user