mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 23:11:38 +00:00
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:
parent
a4d95f3f53
commit
7a86ea2d41
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue