mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-20 16:59:06 +00:00
XEEN: Fix saving maps with no objects and/or monsters
This commit is contained in:
parent
81b9f9b0fc
commit
a8961fc145
@ -738,27 +738,37 @@ void MonsterObjectData::synchronize(XeenSerializer &s, MonsterData &monsterData)
|
||||
|
||||
if (s.isSaving()) {
|
||||
// Save objects
|
||||
for (uint i = 0; i < _objects.size(); ++i) {
|
||||
mobStruct._pos = _objects[i]._position;
|
||||
mobStruct._id = _objects[i]._id;
|
||||
mobStruct._direction = _objects[i]._direction;
|
||||
mobStruct.synchronize(s);
|
||||
if (_objects.empty()) {
|
||||
MobStruct nullStruct;
|
||||
nullStruct.synchronize(s);
|
||||
} else {
|
||||
for (uint i = 0; i < _objects.size(); ++i) {
|
||||
mobStruct._pos = _objects[i]._position;
|
||||
mobStruct._id = _objects[i]._id;
|
||||
mobStruct._direction = _objects[i]._direction;
|
||||
mobStruct.synchronize(s);
|
||||
}
|
||||
}
|
||||
mobStruct.endOfList();
|
||||
mobStruct.synchronize(s);
|
||||
|
||||
// Save monsters
|
||||
for (uint i = 0; i < _monsters.size(); ++i) {
|
||||
mobStruct._pos = _monsters[i]._position;
|
||||
mobStruct._id = _monsters[i]._id;
|
||||
mobStruct._direction = DIR_NORTH;
|
||||
mobStruct.synchronize(s);
|
||||
if (_monsters.empty()) {
|
||||
MobStruct nullStruct;
|
||||
nullStruct.synchronize(s);
|
||||
} else {
|
||||
for (uint i = 0; i < _monsters.size(); ++i) {
|
||||
mobStruct._pos = _monsters[i]._position;
|
||||
mobStruct._id = _monsters[i]._id;
|
||||
mobStruct._direction = DIR_NORTH;
|
||||
mobStruct.synchronize(s);
|
||||
}
|
||||
}
|
||||
mobStruct.endOfList();
|
||||
mobStruct.synchronize(s);
|
||||
|
||||
// Save wall items
|
||||
if (_wallItems.size() == 0) {
|
||||
if (_wallItems.empty()) {
|
||||
MobStruct nullStruct;
|
||||
nullStruct._pos.x = nullStruct._pos.y = 0x80;
|
||||
nullStruct.synchronize(s);
|
||||
|
Loading…
Reference in New Issue
Block a user