qbism / q2tools-220

Quake 2 map compiler tools with v220 map support, automatic phong, enhancements, and fixes.
GNU General Public License v2.0
61 stars 20 forks source link

Incorrect numareaportals in Windows build #35

Closed qbism closed 1 year ago

qbism commented 1 year ago

In a map with numareaportals = 0, it is being read as 7012672 from a bsp produced with the Windows q2pro build. The bsp output from the Linux build is correctly read as 0. This was observed in Q2PRO when the bsp would not open with a "BSP_LoadAreas: bad areaportals" error.

qbism commented 1 year ago

uggh, github bot automatically closed this because it was mentioned in a commit. Not fixed

qbism commented 1 year ago

I tracked this down to EmitAreaPortals. Not sure of the intent, but the result is an uninitialized array value. Next commit will fix.

` // was numareaportals = 1: // leave 0 as an error // qb: may create an error itself with dareas[0].numareaportals undefined. numareaportals = 0;

for (i = 0; i < c_areas; i++) { // qb: was (i = 1; i <=c_areas; i++)

`