diff --git a/src/bsp/Bsp.cpp b/src/bsp/Bsp.cpp index 4f56c746..1c8303aa 100644 --- a/src/bsp/Bsp.cpp +++ b/src/bsp/Bsp.cpp @@ -2851,7 +2851,7 @@ bool Bsp::downscale_texture(int textureId, int maxDim) { return false; } - downscale_texture(textureId, newWidth, newHeight); + return downscale_texture(textureId, newWidth, newHeight); } void Bsp::downscale_invalid_textures() { @@ -3543,6 +3543,15 @@ bool Bsp::validate() { isValid = false; } } + + if (nodes[i].nMins[0] > nodes[i].nMaxs[0] || + nodes[i].nMins[1] > nodes[i].nMaxs[1] || + nodes[i].nMins[2] > nodes[i].nMaxs[2]) { + logf("Backwards mins/maxs in node %d. Mins: (%d, %d, %d) Maxs: (%d %d %d)\n", i, + (int)nodes[i].nMins[0], (int)nodes[i].nMins[1], (int)nodes[i].nMins[2], + (int)nodes[i].nMaxs[0], (int)nodes[i].nMaxs[1], (int)nodes[i].nMaxs[2]); + isValid = false; + } } for (int i = 0; i < planeCount; i++) { BSPPLANE& plane = planes[i]; diff --git a/src/editor/Gui.cpp b/src/editor/Gui.cpp index 7af0b53a..226a83df 100644 --- a/src/editor/Gui.cpp +++ b/src/editor/Gui.cpp @@ -1775,9 +1775,16 @@ void Gui::drawKeyvalueEditor_SmartEditTab(Entity* ent) { string value = ent->keyvalues[key]; string niceName = keyvalue.description; - if (value.empty() && keyvalue.defaultValue.length()) { - value = keyvalue.defaultValue; - } + // TODO: ImGui doesn't have placeholder text like in HTML forms, + // but it would be nice to show an example/default value here somehow. + // Forcing the default value is bad because that can change entity behavior + // in unexpected ways. The default should always be an empty string or 0 when + // you don't care about the key. I think I remember there being strange problems + // when JACK would autofill default values for every possible key in an entity. + // + //if (value.empty() && keyvalue.defaultValue.length()) { + // value = keyvalue.defaultValue; + //} strcpy(keyNames[i], niceName.c_str()); strcpy(keyValues[i], value.c_str()); @@ -1840,13 +1847,7 @@ void Gui::drawKeyvalueEditor_SmartEditTab(Entity* ent) { string newVal = data->Buf; if (newVal.empty()) { - if (inputData->defaultValue.length()) { - ent->setOrAddKeyvalue(inputData->key, inputData->defaultValue); - } - else { - ent->removeKeyvalue(inputData->key); - } - + ent->removeKeyvalue(inputData->key); } else { ent->setOrAddKeyvalue(inputData->key, newVal);