TITANIC: Fixes for allocating an assigned room

This commit is contained in:
Paul Gilbert 2016-11-06 19:44:32 -05:00
parent 345863d7b6
commit 42d6680837
2 changed files with 11 additions and 13 deletions

View File

@ -148,7 +148,7 @@ CString CRoomFlags::getRoomDesc() const {
result += ", ";
result += getElevatorDesc();
result += ", ";
result += getRoomDesc();
result += getRoomNumDesc();
return result;
}
@ -269,21 +269,20 @@ uint CRoomFlags::decodeFloorBits(uint bits) const {
int offset = bits & 0xF;
switch ((bits >> 4) & 0xF) {
case 1:
case 2:
case 3:
base = 40;
case 9:
base = 0;
break;
case 4:
case 0xD:
base = 10;
break;
case 5:
case 0xE:
base = 20;
break;
case 6:
case 0xF:
base = 30;
break;
default:
base = 40;
break;
}
@ -474,7 +473,7 @@ bool CRoomFlags::isTitania(uint flags1, uint flags2) {
return flags2 == 0x8A397;
}
void CRoomFlags::setRandomLocation(int classNum, bool flag) {
void CRoomFlags::setRandomLocation(PassengerClass classNum, bool flag) {
uint minRoom, elevNum, maxRoom, maxFloor, minFloor;
do {
@ -500,9 +499,7 @@ void CRoomFlags::setRandomLocation(int classNum, bool flag) {
minFloor = 28;
maxFloor = 38;
maxRoom = 18;
elevNum = g_vm->getRandomNumber(1);
if (elevNum == 1)
elevNum = 2;
elevNum = g_vm->getRandomNumber(1) ? 2 : 0;
break;
default:
@ -514,6 +511,7 @@ void CRoomFlags::setRandomLocation(int classNum, bool flag) {
setElevatorBits(elevNum);
setRoomBits(roomNum);
setFloorNum(floorNum);
setPassengerClassBits(classNum);
} while (_data == 0x59706);
}

View File

@ -206,7 +206,7 @@ public:
/**
* Sets a random destination in the flags
*/
void setRandomLocation(int classNum, bool flag);
void setRandomLocation(PassengerClass classNum, bool flag);
/**
* Gets the succubus number associated with a given room