ULTIMA8: Update fast area during item create from usecode.

Fixes invalid placement of barrel #14839
This commit is contained in:
Matthew Jimenez 2024-05-17 20:33:52 -05:00
parent 007e377148
commit 548c6e019d

View File

@ -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;