diff --git a/scumm/actor.cpp b/scumm/actor.cpp index e2ab510cf35..3556019d5bc 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -112,7 +112,7 @@ void Actor::setActorWalkSpeed(uint newSpeedX, uint newSpeedY) int Scumm::getAngleFromPos(int x, int y) { - if (_gameId == GID_DIG) { + if (_gameId == GID_DIG || _gameId == GID_CMI) { double temp = atan2((double)x, (double)-y); return normalizeAngle((int)(temp * 180 / 3.1415926535)); } else { diff --git a/scumm/object.cpp b/scumm/object.cpp index 073f7733724..d988b3209b1 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -218,7 +218,7 @@ void Scumm::getObjectXYPos(int object, int &x, int &y, int &dir) y = od->walk_y; } if (_features & GF_AFTER_V8) - dir = od->actordir; + dir = fromSimpleDir(1, od->actordir); else dir = oldDirToNewDir(od->actordir & 3); } @@ -657,7 +657,8 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room, byte *searchptr) od->y_pos = (int)READ_LE_UINT32(&imhd->v8.y_pos); od->width = (uint)READ_LE_UINT32(&imhd->v8.width); od->height = (uint)READ_LE_UINT32(&imhd->v8.height); - od->actordir = (byte)READ_LE_UINT32(&imhd->v8.actordir); + // HACK: This is done sinec an angle doesn't fit into a byte (360 > 256) + od->actordir = toSimpleDir(1, READ_LE_UINT32(&imhd->v8.actordir)); } else if (_features & GF_AFTER_V7) { od->obj_nr = READ_LE_UINT16(&(cdhd->v7.obj_id));