Skip to content

Commit 6212940

Browse files
committed
crash fixes
- viewing keyvalues for an entity with more than 64 fgd keys - specific click combination when moving an ent for the first time
1 parent 3675051 commit 6212940

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/bsp/bsplimits.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#define MAXTEXTURENAME 16
66
#define MIPLEVELS 4
77

8-
#define MAX_KEYS_PER_ENT 64 // just guessing
8+
#define MAX_KEYS_PER_ENT 128 // just guessing
99
#define MAX_KEY_LEN 256 // not sure if this includes the null char
1010
#define MAX_VAL_LEN 4096 // not sure if this includes the null char
1111

src/editor/Gui.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2124,10 +2124,10 @@ void Gui::drawKeyvalueEditor_SmartEditTab(Entity* ent) {
21242124

21252125
if (fgdClass != NULL) {
21262126

2127-
static InputData inputData[128];
2127+
static InputData inputData[MAX_KEYS_PER_ENT];
21282128
static int lastPickCount = 0;
21292129

2130-
for (int i = 0; i < fgdClass->keyvalues.size() && i < 128; i++) {
2130+
for (int i = 0; i < fgdClass->keyvalues.size() && i < MAX_KEYS_PER_ENT; i++) {
21312131
KeyvalueDef& keyvalue = fgdClass->keyvalues[i];
21322132
string key = keyvalue.name;
21332133
if (key == "spawnflags") {

src/editor/Renderer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ void Renderer::cameraPickingControls() {
10011001
draggingAxis = -1;
10021002
applyTransform();
10031003

1004-
if (pickInfo.valid && pickInfo.ent && undoEntityState->getOrigin() != pickInfo.ent->getOrigin()) {
1004+
if (pickInfo.valid && pickInfo.ent && undoEntityState && undoEntityState->getOrigin() != pickInfo.ent->getOrigin()) {
10051005
pushEntityUndoState("Move Entity");
10061006
}
10071007
}

0 commit comments

Comments
 (0)