Do not use the bsp2 header when byteswapping the header.

The bsp2 header is not necessarily correct (or even present), but the bsp29
header is: it was setup via set_bsp32_write. This fixes the bsp corruption
when vising a map (and, I expect, any problems with qfbsp on a big-endian
machine).
This commit is contained in:
Bill Currie 2012-12-29 20:57:55 +09:00
parent a4d95f3f53
commit 7a86ea2d41

View file

@ -159,13 +159,13 @@ swap_to_bsp29 (bsp29_t *bsp29, const bsp_t *bsp2)
dmiptexlump_t *mtl;
dmodel_t *d;
if (bsp2->header && bsp29->header) {
bsp29->header->version = LittleLong (bsp2->header->version);
if (bsp29->header) {
bsp29->header->version = LittleLong (bsp29->header->version);
for (i = 0; i < HEADER_LUMPS; i++) {
bsp29->header->lumps[i].fileofs =
LittleLong (bsp2->header->lumps[i].fileofs);
LittleLong (bsp29->header->lumps[i].fileofs);
bsp29->header->lumps[i].filelen =
LittleLong (bsp2->header->lumps[i].filelen);
LittleLong (bsp29->header->lumps[i].filelen);
}
}