Skip to content

Commit c9c1a10

Browse files
committed
Fixed get_key_value_string for "train"
1 parent 406dcbd commit c9c1a10

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/modules/entities/entities_entity.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,11 @@ str CBaseEntityWrapper::GetKeyValueString(const char* szName)
220220
char szResult[MAX_KEY_VALUE_LENGTH];
221221
GetKeyValueStringRaw(szName, szResult, MAX_KEY_VALUE_LENGTH);
222222

223+
// TODO: Don't hardcode this
223224
// Fix for field name "model". I think a string_t object is copied to szResult.
224-
if (strcmp(szName, "model") == 0)
225-
return *(char **) szResult;
225+
// https://developer.valvesoftware.com/wiki/Team_train_watcher
226+
if (strcmp(szName, "model") == 0 || strcmp(szName, "train") == 0)
227+
return str(*(char **) szResult);
226228

227229
return str(szResult);
228230
}

0 commit comments

Comments
 (0)