a few more PRVM_EDICTFIELDVALUE/PRVM_GLOBALFIELDVALUE uses fixed
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 8 May 2011 18:37:26 +0000 (18:37 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 8 May 2011 18:37:26 +0000 (18:37 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11129 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c
prvm_exec.c
sv_user.c

index 8f9b3ec..81ada17 100644 (file)
@@ -7031,9 +7031,9 @@ static void R_DrawEntityBBoxes(void)
                if (edict->priv.server->free)
                        continue;
                // exclude the following for now, as they don't live in world coordinate space and can't be solid:
-               if(PRVM_EDICTFIELDVALUE(edict, prog->fieldoffsets.tag_entity)->edict != 0)
+               if(PRVM_EDICTFIELDEDICT(edict, prog->fieldoffsets.tag_entity) != 0)
                        continue;
-               if(PRVM_EDICTFIELDVALUE(edict, prog->fieldoffsets.viewmodelforclient)->edict != 0)
+               if(PRVM_EDICTFIELDEDICT(edict, prog->fieldoffsets.viewmodelforclient) != 0)
                        continue;
                VectorLerp(edict->priv.server->areamins, 0.5f, edict->priv.server->areamaxs, center);
                R_MeshQueue_AddTransparent(center, R_DrawEntityBBoxes_Callback, (entity_render_t *)NULL, i, (rtlight_t *)NULL);
index 6deb4d9..d53b213 100644 (file)
@@ -694,8 +694,8 @@ void MVM_ExecuteProgram (func_t fnum, const char *errormessage)
 
        if (!fnum || fnum >= (unsigned int)prog->numfunctions)
        {
-               if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
-                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict), NULL);
+               if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDEDICT(prog->globaloffsets.self))
+                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDEDICT(prog->globaloffsets.self)), NULL);
                PRVM_ERROR ("MVM_ExecuteProgram: %s", errormessage);
        }
 
@@ -783,8 +783,8 @@ void CLVM_ExecuteProgram (func_t fnum, const char *errormessage)
 
        if (!fnum || fnum >= (unsigned int)prog->numfunctions)
        {
-               if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
-                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict), NULL);
+               if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDEDICT(prog->globaloffsets.self))
+                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDEDICT(prog->globaloffsets.self)), NULL);
                PRVM_ERROR ("CLVM_ExecuteProgram: %s", errormessage);
        }
 
@@ -873,8 +873,8 @@ void SVVM_ExecuteProgram (func_t fnum, const char *errormessage)
 
        if (!fnum || fnum >= (unsigned int)prog->numfunctions)
        {
-               if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
-                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict), NULL);
+               if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDEDICT(prog->globaloffsets.self))
+                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDEDICT(prog->globaloffsets.self)), NULL);
                PRVM_ERROR ("SVVM_ExecuteProgram: %s", errormessage);
        }
 
index f8b666a..4a70f1a 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -759,7 +759,7 @@ void SV_ApplyClientMove (void)
        VectorCopy(move->cursor_screen, PRVM_EDICTFIELDVECTOR(host_client->edict, prog->fieldoffsets.cursor_screen));
        VectorCopy(move->cursor_start, PRVM_EDICTFIELDVECTOR(host_client->edict, prog->fieldoffsets.cursor_trace_start));
        VectorCopy(move->cursor_impact, PRVM_EDICTFIELDVECTOR(host_client->edict, prog->fieldoffsets.cursor_trace_endpos));
-       PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_trace_ent)->edict = PRVM_EDICT_TO_PROG(PRVM_EDICT_NUM(move->cursor_entitynumber));
+       PRVM_EDICTFIELDEDICT(host_client->edict, prog->fieldoffsets.cursor_trace_ent) = PRVM_EDICT_TO_PROG(PRVM_EDICT_NUM(move->cursor_entitynumber));
        PRVM_EDICTFIELDFLOAT(host_client->edict, prog->fieldoffsets.ping) = host_client->ping * 1000.0;
        PRVM_EDICTFIELDFLOAT(host_client->edict, prog->fieldoffsets.ping_packetloss) = packetloss / (float) NETGRAPH_PACKETS;
        PRVM_EDICTFIELDFLOAT(host_client->edict, prog->fieldoffsets.ping_movementloss) = movementloss / (float) NETGRAPH_PACKETS;