Convert all integer operands to float for v6 progs.

Converting only opc is no longer enough.
This commit is contained in:
Bill Currie 2011-01-27 09:00:11 +09:00
parent 1ed1efbdfb
commit f532fbc6df

View file

@ -116,9 +116,18 @@ opcode_init (void)
for (op = pr_opcodes; op->name; op++) {
if (op->min_version > options.code.progsversion)
continue;
if (options.code.progsversion == PROG_ID_VERSION
&& op->type_c == ev_integer)
op->type_c = ev_float;
if (options.code.progsversion == PROG_ID_VERSION) {
// v6 progs have no concept of integer, but the QF engine
// treats the operands of certain operands as integers
// irrespective the progs version, so convert the engine's
// view of the operands to the prog's view.
if (op->type_a == ev_integer)
op->type_a = ev_float;
if (op->type_b == ev_integer)
op->type_b = ev_float;
if (op->type_c == ev_integer)
op->type_c = ev_float;
}
Hash_AddElement (opcode_type_table, op);
if (!strcmp (op->name, "<DONE>")) {
op_done = op;