mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-03 00:35:54 +00:00
ULTIMA8: Update fast area during item create from usecode.
Fixes invalid placement of barrel #14839
This commit is contained in:
parent
007e377148
commit
548c6e019d
@ -3185,8 +3185,14 @@ uint32 Item::I_legalCreateAtPoint(const uint8 *args, unsigned int /*argsize*/) {
|
||||
|
||||
World_FromUsecodeXY(x, y);
|
||||
|
||||
// check if item can exist
|
||||
const ShapeInfo *si = GameData::get_instance()->getMainShapes()->getShapeInfo(shape);
|
||||
int32 xd, yd, zd;
|
||||
si->getFootpadWorld(xd, yd, zd, 0);
|
||||
|
||||
CurrentMap *cm = World::get_instance()->getCurrentMap();
|
||||
cm->updateFastArea(x, y, z, x - xd, y - yd, z + zd);
|
||||
|
||||
// check if item can exist
|
||||
PositionInfo info = cm->getPositionInfo(x, y, z, shape, 0);
|
||||
if (!info.valid)
|
||||
return 0;
|
||||
@ -3217,8 +3223,14 @@ uint32 Item::I_legalCreateAtCoords(const uint8 *args, unsigned int /*argsize*/)
|
||||
|
||||
World_FromUsecodeXY(x, y);
|
||||
|
||||
// check if item can exist
|
||||
const ShapeInfo *si = GameData::get_instance()->getMainShapes()->getShapeInfo(shape);
|
||||
int32 xd, yd, zd;
|
||||
si->getFootpadWorld(xd, yd, zd, 0);
|
||||
|
||||
CurrentMap *cm = World::get_instance()->getCurrentMap();
|
||||
cm->updateFastArea(x, y, z, x - xd, y - yd, z + zd);
|
||||
|
||||
// check if item can exist
|
||||
PositionInfo info = cm->getPositionInfo(x, y, z, shape, 0);
|
||||
if (!info.valid)
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user