[Scummvm-git-logs] scummvm master -> 67c76493e3717adf96ea2bf3c2535f4ed3fce6cb
OMGPizzaGuy
noreply at scummvm.org
Thu Mar 28 12:49:36 UTC 2024
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:
67c76493e3 ULTIMA8: FIx return values of minimap sampling
Commit: 67c76493e3717adf96ea2bf3c2535f4ed3fce6cb
https://github.com/scummvm/scummvm/commit/67c76493e3717adf96ea2bf3c2535f4ed3fce6cb
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-03-28T07:49:20-05:00
Commit Message:
ULTIMA8: FIx return values of minimap sampling
Changed paths:
engines/ultima/ultima8/world/minimap.cpp
diff --git a/engines/ultima/ultima8/world/minimap.cpp b/engines/ultima/ultima8/world/minimap.cpp
index c4c651bbc29..5c1d1673793 100644
--- a/engines/ultima/ultima8/world/minimap.cpp
+++ b/engines/ultima/ultima8/world/minimap.cpp
@@ -89,20 +89,19 @@ uint32 MiniMap::sampleAtPoint(const CurrentMap &map, int x, int y) {
int32 dims[3] = {0, 0, 0};
uint32 shflags = ShapeInfo::SI_ROOF | ShapeInfo::SI_OCCL | ShapeInfo::SI_LAND | ShapeInfo::SI_SEA;
Std::list<CurrentMap::SweepItem> collisions;
- if (!map.sweepTest(start, end, dims, shflags, 0, false, &collisions))
- return 0;
-
- Std::list<CurrentMap::SweepItem>::const_iterator it;
- for (it = collisions.begin(); it != collisions.end(); it++) {
- const Item *item = getItem(it->_item);
- if (item) {
- const ShapeInfo *si = item->getShapeInfo();
- if (!(si->_flags & shflags) || si->is_editor() || si->is_translucent())
- continue;
-
- uint32 val = sampleAtPoint(*item, x, y);
- if (val != KEY_COLOR)
- return val;
+ if (map.sweepTest(start, end, dims, shflags, 0, false, &collisions)) {
+ Std::list<CurrentMap::SweepItem>::const_iterator it;
+ for (it = collisions.begin(); it != collisions.end(); it++) {
+ const Item *item = getItem(it->_item);
+ if (item) {
+ const ShapeInfo *si = item->getShapeInfo();
+ if (!(si->_flags & shflags) || si->is_editor() || si->is_translucent())
+ continue;
+
+ uint32 val = sampleAtPoint(*item, x, y);
+ if (val != KEY_COLOR)
+ return val;
+ }
}
}
@@ -120,18 +119,18 @@ uint32 MiniMap::sampleAtPoint(const Item &item, int x, int y) {
const Shape *sh = item.getShapeObject();
if (!sh)
- return 0;
+ return KEY_COLOR;
const ShapeFrame *frame = sh->getFrame(item.getFrame());
if (!frame)
- return 0;
+ return KEY_COLOR;
const Palette *pal = sh->getPalette();
if (!pal)
- return 0;
+ return KEY_COLOR;
if (item.canDrag())
- return 0;
+ return KEY_COLOR;
// Screenspace bounding box bottom x_ coord (RNB x_ coord)
int sx = (ix - iy) / 4;
More information about the Scummvm-git-logs
mailing list