mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-29 20:20:43 +00:00
print an address if the def name is blank
This commit is contained in:
parent
ea552ae68e
commit
cbe006a2fb
1 changed files with 16 additions and 5 deletions
|
@ -307,6 +307,8 @@ PR_GlobalString (progs_t *pr, int ofs, etype_t type)
|
||||||
if (type == ev_void)
|
if (type == ev_void)
|
||||||
type = def->type;
|
type = def->type;
|
||||||
name = PR_GetString (pr, def->s_name);
|
name = PR_GetString (pr, def->s_name);
|
||||||
|
if (!*name)
|
||||||
|
dsprintf (line, "[$%x]", ofs);
|
||||||
if (type != (etype_t) (def->type & ~DEF_SAVEGLOBAL))
|
if (type != (etype_t) (def->type & ~DEF_SAVEGLOBAL))
|
||||||
oi = "?";
|
oi = "?";
|
||||||
}
|
}
|
||||||
|
@ -322,11 +324,17 @@ PR_GlobalString (progs_t *pr, int ofs, etype_t type)
|
||||||
else
|
else
|
||||||
dsprintf (line, "%s", s);
|
dsprintf (line, "%s", s);
|
||||||
} else if (strequal(name, "?"))
|
} else if (strequal(name, "?"))
|
||||||
dsprintf (line, "[$%x](%08x)%s", ofs,
|
if (type == ev_string)
|
||||||
pr->pr_globals[ofs].integer_var, s);
|
dsprintf (line, "[$%x](%08x)\"%s\"", ofs,
|
||||||
|
pr->pr_globals[ofs].integer_var, s);
|
||||||
|
else
|
||||||
|
dsprintf (line, "[$%x](%08x)%s", ofs,
|
||||||
|
pr->pr_globals[ofs].integer_var, s);
|
||||||
else {
|
else {
|
||||||
if (type == ev_func)
|
if (type == ev_func)
|
||||||
dsprintf (line, "%s%s", name, oi);
|
dsprintf (line, "%s%s", name, oi);
|
||||||
|
else if (type == ev_string)
|
||||||
|
dsprintf (line, "%s%s\"%s\"", name, oi, s);
|
||||||
else
|
else
|
||||||
dsprintf (line, "%s%s(%s)", name, oi, s);
|
dsprintf (line, "%s%s(%s)", name, oi, s);
|
||||||
}
|
}
|
||||||
|
@ -337,8 +345,9 @@ PR_GlobalString (progs_t *pr, int ofs, etype_t type)
|
||||||
const char *
|
const char *
|
||||||
PR_GlobalStringNoContents (progs_t *pr, int ofs, etype_t type)
|
PR_GlobalStringNoContents (progs_t *pr, int ofs, etype_t type)
|
||||||
{
|
{
|
||||||
static dstring_t *line = NULL;
|
static dstring_t *line = NULL;
|
||||||
ddef_t *def = NULL;
|
ddef_t *def = NULL;
|
||||||
|
const char *name;
|
||||||
|
|
||||||
if (!line)
|
if (!line)
|
||||||
line = dstring_newstr();
|
line = dstring_newstr();
|
||||||
|
@ -354,8 +363,10 @@ PR_GlobalStringNoContents (progs_t *pr, int ofs, etype_t type)
|
||||||
def = ED_GlobalAtOfs (pr, ofs);
|
def = ED_GlobalAtOfs (pr, ofs);
|
||||||
if (!def)
|
if (!def)
|
||||||
dsprintf (line, "[$%x]", ofs);
|
dsprintf (line, "[$%x]", ofs);
|
||||||
|
else if (!*(name = PR_GetString (pr, def->s_name)))
|
||||||
|
dsprintf (line, "[$%x]", ofs);
|
||||||
else
|
else
|
||||||
dsprintf (line, "%s", PR_GetString (pr, def->s_name));
|
dsprintf (line, "%s", name);
|
||||||
|
|
||||||
return line->str;
|
return line->str;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue