Report the source line of the entity in messages.

For now, just when PrintEntity is used to print the message, but having the
first line of the entity sure makes life easier.
This commit is contained in:
Bill Currie 2012-09-12 08:33:44 +09:00
parent db25d5597d
commit bcda96a445
2 changed files with 3 additions and 0 deletions

View file

@ -51,6 +51,7 @@ typedef struct epair_s {
/** In-memory representation of an entity as parsed from the map script.
*/
typedef struct {
int line; ///< Map line of entity start (for messages)
vec3_t origin; ///< Location of this entity in world-space.
mbrush_t *brushes; ///< Nul terminated list of brushes.
epair_t *epairs; ///< Nul terminated list of key=value pairs.

View file

@ -465,6 +465,7 @@ ParseEntity (void)
mapent = &entities[num_entities];
num_entities++;
memset (mapent, 0, sizeof (entity_t));
mapent->line = map_script->line;
do {
if (!Script_GetToken (map_script, true))
@ -552,6 +553,7 @@ PrintEntity (const entity_t *ent)
{
const epair_t *ep;
printf ("%20s : %d\n", "map source line", ent->line);
for (ep = ent->epairs; ep; ep = ep->next)
printf ("%20s : %s\n", ep->key, ep->value);
}