[gamecode] Respect the @float_promoted@ magic string

Rather than relying on progs code version, use the string to determine
whether PR_Sprintf should behave as if floats have been promoted through
... I imagine I'll get to the rest of the server code at some stage.

With these two changes, nq-x11 works again (teleporters were the
symptom).
This commit is contained in:
Bill Currie 2020-03-08 19:17:24 +09:00
parent 89ec86f77f
commit c726d77e7d
2 changed files with 7 additions and 2 deletions

View file

@ -202,8 +202,6 @@ PR_LoadProgsFile (progs_t *pr, QFile *file, int size)
base -= sizeof (progs); // offsets are from file start
heap = ((byte *) pr->progs + pr->progs_size + pr->pr_edictareasize);
pr->float_promoted = progs.version == PROG_VERSION;
if (pr->edicts) {
*pr->edicts = (edict_t *)((byte *) pr->progs + pr->progs_size);
}

View file

@ -238,8 +238,15 @@ PR_LoadStrings (progs_t *pr)
char *str = pr->pr_strings;
int count = 0;
pr->float_promoted = 0;
while (str < end) {
count++;
if (*str == '@' && pr->progs->version == PROG_VERSION) {
if (!strcmp (str, "@float_promoted@")) {
pr->float_promoted = 1;
}
}
str += strlen (str) + 1;
}