diff --git a/polymer/eduke32/build/src/scriptfile.c b/polymer/eduke32/build/src/scriptfile.c index ebdc2b8a1..e07dbba89 100644 --- a/polymer/eduke32/build/src/scriptfile.c +++ b/polymer/eduke32/build/src/scriptfile.c @@ -349,6 +349,20 @@ static char *getsymbtabspace(int32_t reqd) int32_t scriptfile_getsymbolvalue(char const *name, int32_t *val) { + if (Bstrlen(name) > 2) + { + if (tolower(name[1]) == 'x') // hex constants + { + int64_t x; + sscanf(name + 2, "%" PRIx64 "", &x); + + if (EDUKE32_PREDICT_FALSE(x > UINT32_MAX)) + initprintf("warning: number 0x%" PRIx64 " truncated to 32 bits.\n", x); + + *val = x; + return 1; + } + } char *scanner = symbtab; if (!symbtab) return 0;