/* ==================== ED_ParseEdict Parses an edict out of the given string, returning the new position ed should be a properly initialized empty edict. ==================== */ char *ED_ParseEdict (char *data, edict_t *ent) { qboolean init; char keyname[256]; char *com_token; //Knightmare added qboolean alias_loaded = false; init = false; memset (&st, 0, sizeof(st)); // Knightmare- look for and load an alias for this ent alias_loaded = ED_ParseEntityAlias (data, ent); // go through all the dictionary pairs while (1) { // parse key com_token = COM_Parse (&data); if (com_token[0] == '}') break; if (!data) gi.error ("ED_ParseEntity: EOF without closing brace"); strncpy (keyname, com_token, sizeof(keyname)-1); // parse value com_token = COM_Parse (&data); if (!data) gi.error ("ED_ParseEntity: EOF without closing brace"); if (com_token[0] == '}') gi.error ("ED_ParseEntity: closing brace without data"); init = true; // keynames with a leading underscore are used for utility comments, // and are immediately discarded by quake if (keyname[0] == '_') continue; // Knightmare- if the classname was replaced by an alias, don't load it back if (alias_loaded && !strcmp(keyname, "classname")) continue; ED_ParseField (keyname, com_token, ent); } if (!init) memset (ent, 0, sizeof(*ent)); return data; }
/* ==================== ED_ParseEdict Parses an edict out of the given string, returning the new position ed should be a properly initialized empty edict. ==================== */ char *ED_ParseEdict (char *data, edict_t *ent) { qboolean init; char keyname[256]; char *com_token; //Knightmare added qboolean alias_loaded = false; init = false; memset (&st, 0, sizeof(st)); // Knightmare- look for and load an alias for this ent alias_loaded = ED_ParseEntityAlias (data, ent); // go through all the dictionary pairs while (1) { // parse key com_token = COM_Parse (&data); if (com_token[0] == '}') break; if (!data) gi.error ("ED_ParseEntity: EOF without closing brace"); strncpy (keyname, com_token, sizeof(keyname)-1); // parse value com_token = COM_Parse (&data); if (!data) gi.error ("ED_ParseEntity: EOF without closing brace"); if (com_token[0] == '}') gi.error ("ED_ParseEntity: closing brace without data"); init = true; // Knightmare: check for _clientonly here if (!strcmp(keyname, "_clientonly")) { int val = atoi(com_token); // value of 2 or higher = remove, 1 = server-side bbox clip only if (val > 1) G_FreeEdict (ent); else if (val == 1) ent->svflags |= SVF_NOCLIENT; } // keynames with a leading underscore are used for utility comments, // and are immediately discarded by quake if (keyname[0] == '_') continue; // Knightmare- if the classname was replaced by an alias, don't load it back if (alias_loaded && !strcmp(keyname, "classname")) continue; ED_ParseField (keyname, com_token, ent); } if (!init) memset (ent, 0, sizeof(*ent)); return data; }