mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-14 09:04:31 +02:00
fix infinite loop in getSector
This commit is contained in:
24
src/format.h
24
src/format.h
@@ -2488,18 +2488,19 @@ namespace TR {
|
|||||||
name[len] = 0;
|
name[len] = 0;
|
||||||
LOG("load Sega Saturn level: %s\n", name);
|
LOG("load Sega Saturn level: %s\n", name);
|
||||||
|
|
||||||
readSAT(stream);
|
|
||||||
|
|
||||||
strcat(name, ".SAD");
|
strcat(name, ".SAD");
|
||||||
readSAT(Stream(name));
|
Stream sad(name);
|
||||||
name[len] = '\0';
|
name[len] = '\0';
|
||||||
|
|
||||||
strcat(name, ".SPR");
|
strcat(name, ".SPR");
|
||||||
readSAT(Stream(name));
|
Stream spr(name);
|
||||||
name[len] = '\0';
|
name[len] = '\0';
|
||||||
|
|
||||||
strcat(name, ".SND");
|
strcat(name, ".SND");
|
||||||
readSAT(Stream(name));
|
Stream snd(name);
|
||||||
|
|
||||||
|
readSAT(stream); // sat
|
||||||
|
readSAT(sad);
|
||||||
|
readSAT(spr);
|
||||||
|
readSAT(snd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3531,8 +3532,8 @@ namespace TR {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CHUNK("SAMPLE ") : {
|
case CHUNK("SAMPLE ") : {
|
||||||
int index = stream.readBE32();
|
int32 index = stream.readBE32();
|
||||||
int count = stream.readBE32();
|
int32 count = stream.readBE32();
|
||||||
stream.seek(count); // TODO
|
stream.seek(count); // TODO
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -5008,6 +5009,8 @@ namespace TR {
|
|||||||
int z = int(pos.z);
|
int z = int(pos.z);
|
||||||
|
|
||||||
// check horizontal
|
// check horizontal
|
||||||
|
int16 prevRoom = roomIndex;
|
||||||
|
|
||||||
while (1) { // Let's Rock!
|
while (1) { // Let's Rock!
|
||||||
Room &room = rooms[roomIndex];
|
Room &room = rooms[roomIndex];
|
||||||
|
|
||||||
@@ -5023,9 +5026,10 @@ namespace TR {
|
|||||||
sector = room.getSector(sx, sz);
|
sector = room.getSector(sx, sz);
|
||||||
|
|
||||||
int nextRoom = getNextRoom(sector);
|
int nextRoom = getNextRoom(sector);
|
||||||
if (nextRoom == NO_ROOM)
|
if (nextRoom == NO_ROOM || nextRoom == prevRoom)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
prevRoom = roomIndex;
|
||||||
roomIndex = nextRoom;
|
roomIndex = nextRoom;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user