forked from Ports/perfect_dark
Merge branch 'fgsfdsfgs:port' into port
This commit is contained in:
7 files changed
+39
-11
No files matched your search
@@ -1079,7 +1079,12 @@ void creditsResetSlides(void)
|
||||
|
||||
g_CreditsData->coreteammap[i + 1] = pool[index];
|
||||
|
||||
#ifdef AVOID_UB
|
||||
// don't overflow `pool`
|
||||
while (index < NUM_CORE_TEAM - i - 1) {
|
||||
#else
|
||||
while (index < NUM_CORE_TEAM - i) {
|
||||
#endif
|
||||
pool[index] = pool[index + 1];
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -76,9 +76,15 @@ void navSetSeed(u32 upper, u32 lower)
|
||||
struct waypoint *waypointFindClosestToPos(struct coord *pos, RoomNum *rooms)
|
||||
{
|
||||
struct waypoint *closest = NULL;
|
||||
#ifdef AVOID_UB
|
||||
// prevent bgRoomGetNeighbours or roomsAppend from writing out of bounds
|
||||
RoomNum allrooms[31];
|
||||
RoomNum neighbours[11];
|
||||
#else
|
||||
RoomNum allrooms[30];
|
||||
s32 candlen = 0;
|
||||
RoomNum neighbours[10];
|
||||
#endif
|
||||
s32 candlen = 0;
|
||||
s32 i;
|
||||
s32 j;
|
||||
struct waypoint *candwaypoints[10];
|
||||
@@ -94,8 +100,8 @@ struct waypoint *waypointFindClosestToPos(struct coord *pos, RoomNum *rooms)
|
||||
allrooms[i] = -1;
|
||||
|
||||
for (i = 0; rooms[i] != -1; i++) {
|
||||
bgRoomGetNeighbours(rooms[i], neighbours, ARRAYCOUNT(neighbours));
|
||||
roomsAppend(neighbours, allrooms, ARRAYCOUNT(allrooms));
|
||||
bgRoomGetNeighbours(rooms[i], neighbours, 10);
|
||||
roomsAppend(neighbours, allrooms, 30);
|
||||
}
|
||||
|
||||
if (g_StageSetup.waypoints != NULL) {
|
||||
|
||||
@@ -243,7 +243,11 @@ f32 playerChooseSpawnLocation(f32 chrradius, struct coord *dstpos, RoomNum *dstr
|
||||
s32 stack3[2];
|
||||
RoomNum tmppadrooms[2];
|
||||
f32 bestsqdist;
|
||||
#ifdef AVOID_UB
|
||||
RoomNum neighbours[21]; // prevent bgRoomGetNeighbours from writing out of bounds
|
||||
#else
|
||||
RoomNum neighbours[20];
|
||||
#endif
|
||||
|
||||
// Iterate all spawn pads and populate the category arrays
|
||||
for (p = 0; p < numpads; p++) {
|
||||
|
||||
@@ -1248,9 +1248,17 @@ void frEndSession(bool hidetargets)
|
||||
s32 j;
|
||||
s16 propnums[256];
|
||||
s16 *propnumptr;
|
||||
#ifdef AVOID_UB
|
||||
RoomNum rooms[21];
|
||||
#else
|
||||
RoomNum rooms[20];
|
||||
#endif
|
||||
u32 stack1;
|
||||
#ifdef AVOID_UB
|
||||
RoomNum rooms2[11]; // prevent bgRoomGetNeighbours from writing out of bounds
|
||||
#else
|
||||
RoomNum rooms2[10];
|
||||
#endif
|
||||
u32 stack2;
|
||||
|
||||
if (g_FrDataLoaded) {
|
||||
|
||||
+10
-2
@@ -856,7 +856,11 @@ Gfx *weatherRenderRain(Gfx *gdl, struct weatherdata *weather, s32 arg2)
|
||||
u32 stack2;
|
||||
struct coord distcamtobbmax;
|
||||
struct coord distcamtobbmin;
|
||||
#ifdef AVOID_UB
|
||||
RoomNum neighbours[21];
|
||||
#else
|
||||
RoomNum neighbours[20];
|
||||
#endif
|
||||
|
||||
particledata = weather->particledata[arg2];
|
||||
numtris = 0;
|
||||
@@ -1063,7 +1067,7 @@ Gfx *weatherRenderRain(Gfx *gdl, struct weatherdata *weather, s32 arg2)
|
||||
}
|
||||
|
||||
for (scale = 1.0f, t = 0; t < numtestrooms; t++) {
|
||||
numneighbours = bgRoomGetNeighbours(testrooms[t], neighbours, ARRAYCOUNT(neighbours));
|
||||
numneighbours = bgRoomGetNeighbours(testrooms[t], neighbours, 20);
|
||||
|
||||
for (n = 0; n < numneighbours; n++) {
|
||||
if (g_Rooms[neighbours[n]].flags & ROOMFLAG_ONSCREEN) {
|
||||
@@ -2872,7 +2876,11 @@ Gfx *weatherRenderSnow(Gfx *gdl, struct weatherdata *weather, s32 arg2)
|
||||
s32 i; // 184
|
||||
struct coord sp178;
|
||||
struct coord sp16c;
|
||||
#ifdef AVOID_UB
|
||||
RoomNum sp144[21]; // prevent bgRoomGetNeighbours from writing out of bounds
|
||||
#else
|
||||
RoomNum sp144[20];
|
||||
#endif
|
||||
struct coord sp124;
|
||||
struct coord sp118;
|
||||
f32 f26;
|
||||
@@ -3003,7 +3011,7 @@ Gfx *weatherRenderSnow(Gfx *gdl, struct weatherdata *weather, s32 arg2)
|
||||
|
||||
// 4c54
|
||||
for (i = 0; i < sp1268; i++) {
|
||||
numneighbours = bgRoomGetNeighbours(sp126c[i], sp144, ARRAYCOUNT(sp144));
|
||||
numneighbours = bgRoomGetNeighbours(sp126c[i], sp144, 20);
|
||||
|
||||
for (j2 = 0; j2 < numneighbours; j2++) {
|
||||
a0 = true;
|
||||
|
||||
+1
-4
@@ -3993,10 +3993,7 @@ struct gamefile {
|
||||
};
|
||||
|
||||
struct mpchrconfig {
|
||||
/*0x00*/ char name[12]; // up to 10 visible chars plus line break plus null byte
|
||||
/*0x0c*/ u8 unk0c;
|
||||
/*0x0d*/ u8 unk0d;
|
||||
/*0x0e*/ u8 unk0e;
|
||||
/*0x00*/ char name[15];
|
||||
/*0x0f*/ u8 mpheadnum;
|
||||
/*0x10*/ u8 mpbodynum;
|
||||
/*0x11*/ u8 team;
|
||||
|
||||
@@ -2736,8 +2736,8 @@ bool mp3dec000427d8(struct asistream *stream, u32 gr)
|
||||
f32 *sp0c = stream->unk4664[0][0].unk00;
|
||||
s32 i = 0;
|
||||
|
||||
if (stream->window_switching[gr][0] && stream->window_switching[gr][2] == 2) {
|
||||
if (stream->window_switching[gr][4]) {
|
||||
if (stream->window_switching[gr][0] && stream->block_type[gr][0] == 2) {
|
||||
if (stream->mixed_block_flag[gr][0]) {
|
||||
while (i++ < 36) {
|
||||
*(sp10++) = *(sp0c++);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user