[Scummvm-git-logs] scummvm master -> dc8a9487ecc956ea483f97fffebfe6d362fc0cc8
mduggan
mgithub at guarana.org
Fri May 7 03:46:46 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
dc8a9487ec ULTIMA8: Return area search items in same order as original
Commit: dc8a9487ecc956ea483f97fffebfe6d362fc0cc8
https://github.com/scummvm/scummvm/commit/dc8a9487ecc956ea483f97fffebfe6d362fc0cc8
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-07T12:41:51+09:00
Commit Message:
ULTIMA8: Return area search items in same order as original
For most situations this should make no difference, but Crusader: No Remorse
has some behavior where it relies on the items being returned in x/y scan
order, not y/x.
Particularly, in Mission 2 there is a camera which searches for an event
trigger with qlo == 5. There are 2 triggers on the map with that qlo, but the
code previously returned them in the wrong order so the correct event would not
be triggered and the game could not be continued.
This may have previously caused other subtle bugs too.
Changed paths:
engines/ultima/ultima8/world/current_map.cpp
diff --git a/engines/ultima/ultima8/world/current_map.cpp b/engines/ultima/ultima8/world/current_map.cpp
index 696690053b..20bcc75a6f 100644
--- a/engines/ultima/ultima8/world/current_map.cpp
+++ b/engines/ultima/ultima8/world/current_map.cpp
@@ -572,8 +572,8 @@ void CurrentMap::areaSearch(UCList *itemlist, const uint8 *loopscript,
int maxy = ((y + range) / _mapChunkSize) + 1;
clipMapChunks(minx, maxx, miny, maxy);
- for (int cx = minx; cx <= maxx; cx++) {
- for (int cy = miny; cy <= maxy; cy++) {
+ for (int cy = miny; cy <= maxy; cy++) {
+ for (int cx = minx; cx <= maxx; cx++) {
item_list::const_iterator iter;
for (iter = _items[cx][cy].begin();
iter != _items[cx][cy].end(); ++iter) {
@@ -598,7 +598,7 @@ void CurrentMap::areaSearch(UCList *itemlist, const uint8 *loopscript,
// check item against loopscript
if (item->checkLoopScript(loopscript, scriptsize)) {
assert(itemlist->getElementSize() == 2);
- uint16 objid = item->getObjId();
+ const uint16 objid = item->getObjId();
uint8 buf[2];
buf[0] = static_cast<uint8>(objid);
buf[1] = static_cast<uint8>(objid >> 8);
@@ -641,8 +641,8 @@ void CurrentMap::surfaceSearch(UCList *itemlist, const uint8 *loopscript,
int maxy = ((origin[1]) / _mapChunkSize) + 1;
clipMapChunks(minx, maxx, miny, maxy);
- for (int cx = minx; cx <= maxx; cx++) {
- for (int cy = miny; cy <= maxy; cy++) {
+ for (int cy = miny; cy <= maxy; cy++) {
+ for (int cx = minx; cx <= maxx; cx++) {
item_list::const_iterator iter;
for (iter = _items[cx][cy].begin();
iter != _items[cx][cy].end(); ++iter) {
More information about the Scummvm-git-logs
mailing list