-Fixed an old qc bug that's already been existing in the original quake
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 29 Nov 2004 20:43:28 +0000 (20:43 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 29 Nov 2004 20:43:28 +0000 (20:43 +0000)
 (- hopefully it is a bug): ParseEpair was accessing the globals arrays
 instead of writing an offset directly into the value.
-Removed the VM_CheckEmptyString from VM_drawstring.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4798 d7cf8633-e32d-0410-b094-e92efae38249

pr_edict.c
prvm_cmds.c
prvm_edict.c

index 0e8fbc6..bbfd1e4 100644 (file)
@@ -983,7 +983,8 @@ qboolean ED_ParseEpair(edict_t *ent, ddef_t *key, const char *s)
                        Con_DPrintf("ED_ParseEpair: Can't find field %s\n", s);
                        return false;
                }
-               val->_int = G_INT(def->ofs);
+               //val->_int = G_INT(def->ofs); AK Please check this - seems to be an org. quake bug
+               val->_int = def->ofs;
                break;
 
        case ev_function:
index b6c6b16..56c9f4b 100644 (file)
@@ -2642,7 +2642,7 @@ void VM_drawstring(void)
                return;
        }
        
-       VM_CheckEmptyString(string);
+       //VM_CheckEmptyString(string); Why should it be checked - perhaps the menu wants to the precolored letters, too?
        
        pos = PRVM_G_VECTOR(OFS_PARM0);
        scale = PRVM_G_VECTOR(OFS_PARM2);
index 6fe41fa..d3c5bbd 100644 (file)
@@ -965,7 +965,7 @@ qboolean PRVM_ED_ParseEpair(prvm_edict_t *ent, ddef_t *key, const char *s)
                        Con_DPrintf("PRVM_ED_ParseEpair: Can't find field %s in %s\n", s, PRVM_NAME);
                        return false;
                }
-               val->_int = PRVM_G_INT(def->ofs);
+               val->_int = def->ofs;
                break;
 
        case ev_function:
@@ -1483,7 +1483,7 @@ void PRVM_LoadProgs (const char * filename, int numrequiredfunc, char **required
        
        prog->self = PRVM_ED_FindGlobal("self");
 
-       if(PRVM_ED_FindGlobal("time"))
+       if( PRVM_ED_FindGlobal("time") && PRVM_ED_FindGlobal("time")->type == ev_float )
                prog->time = &PRVM_G_FLOAT(PRVM_ED_FindGlobal("time")->ofs);
 
        if(PRVM_ED_FindField ("chain"))