ericwa / ericw-tools

Quake/Hexen 2 Map compiling tools - branch of http://disenchant.net/utils
http://ericwa.github.io/ericw-tools
GNU General Public License v2.0
345 stars 57 forks source link

Typo? #339

Closed ImmortalBLG closed 1 year ago

ImmortalBLG commented 1 year ago

https://github.com/ericwa/ericw-tools/blob/d5e29a1c9024ddfdf7c88ea764dc2494ece56f81/qbsp/csg.cc#L242 Shouldn't there be "if (face.planenum == (clipface.planenum ^ 1) || spurious_onplane) {" ???

ericwa commented 1 year ago

Yeah good catch, it's not doing what the comment on the previous line says. To get a comparison ignoring the plane side, it should be something like:

if ((face.planenum & (~1u)) == (clipface.planenum & (~1u)) || spurious_onplane) {

Paril commented 1 year ago

We don't use it any more, but CSGFaces in brushbsp has the same bug. But yeah in other places in the code, we do do face->planenum & ~1 for these types of sidedness ignoring.