port: don't crash when swapping empty rooms
This commit is contained in:
parent
b4207b3fd9
commit
b9944e8669
|
|
@ -1452,10 +1452,13 @@ void preprocessBgRoom(u8 *data, u32 ofs) {
|
|||
|
||||
// numvertices is actually 0 in the data because fuck you
|
||||
const s32 numverts = ((uintptr_t) rgfx->colours - (uintptr_t) rgfx->vertices) / sizeof(Vtx);
|
||||
Vtx *vertices = PD_PTR_BASEOFS(rgfx->vertices, data, ofs);
|
||||
Vtx *vtx = vertices;
|
||||
for (s32 i = 0; i < numverts; ++i, ++vtx) {
|
||||
preprocessVtx(vtx);
|
||||
Vtx *vertices = NULL;
|
||||
if (rgfx->vertices) {
|
||||
vertices = PD_PTR_BASEOFS(rgfx->vertices, data, ofs);
|
||||
Vtx *vtx = vertices;
|
||||
for (s32 i = 0; i < numverts; ++i, ++vtx) {
|
||||
preprocessVtx(vtx);
|
||||
}
|
||||
}
|
||||
|
||||
// here's hoping that xlublocks and opablocks aren't completely separate trees
|
||||
|
|
|
|||
Loading…
Reference in New Issue