DREAMWEB: Convert resetLocation and purgeALocation to C++

This commit is contained in:
Max Horn 2011-12-20 11:23:51 +01:00
parent f41412186b
commit b6e139d112
7 changed files with 43 additions and 92 deletions

View file

@ -631,4 +631,39 @@ void DreamGenContext::outOfInv() {
delPointer();
}
void DreamBase::resetLocation(uint8 index) {
if (index == 5) {
// delete hotel
purgeALocation(5);
purgeALocation(21);
purgeALocation(22);
purgeALocation(27);
} else if (index == 8) {
// delete TV studio
purgeALocation(8);
purgeALocation(28);
} else if (index == 6) {
// delete sarters
purgeALocation(6);
purgeALocation(20);
purgeALocation(25);
} else if (index == 13) {
// delete boathouse
purgeALocation(13);
purgeALocation(29);
}
data.byte(kRoomscango + index) = 0;
}
void DreamBase::purgeALocation(uint8 index) {
// index == al
for (uint8 i = 0; i < kNumexobjects; ++i) {
DynObject *t = getExAd(i);
if (t->currentLocation == index && t->mapad[0] == 0) {
deleteExObject(i);
}
}
}
} // End of namespace DreamGen