[gamecode] Make def type when indexing size

Fixes #12

However, this is a bit of a band-aid in that the code for global defs
seems redundant (there is very similar code a little above that is
always executed) and the code for field defs should probably be executed
unconditionally: I suspect the problem fixed by
d5454faeb7 still shows with game coded
compiled with recent versions of the compiler, I just haven't tested
any.
This commit is contained in:
Bill Currie 2021-06-13 22:13:47 +09:00
parent 36df16eefc
commit 2278f5e494

View file

@ -257,7 +257,7 @@ PR_LoadProgsFile (progs_t *pr, QFile *file, int size)
pr->pr_statements[i].c = LittleShort (pr->pr_statements[i].c);
}
for (i = 0; i < (size_t) pr->progs->numfunctions; i++) {
for (i = 0; i < pr->progs->numfunctions; i++) {
pr->pr_functions[i].first_statement =
LittleLong (pr->pr_functions[i].first_statement);
pr->pr_functions[i].parm_start =
@ -328,11 +328,11 @@ PR_LoadProgsFile (progs_t *pr, QFile *file, int size)
pr_def_t *def;
for (def = pr->pr_globaldefs, i = 0; i < pr->progs->numglobaldefs;
i++, def++) {
def->size = pr_type_size[def->type];
def->size = pr_type_size[def->type & ~DEF_SAVEGLOBAL];
}
for (def = pr->pr_fielddefs, i = 0; i < pr->progs->numfielddefs;
i++, def++) {
def->size = pr_type_size[def->type];
def->size = pr_type_size[def->type & ~DEF_SAVEGLOBAL];
}
}
pr->pr_trace = 0;