From 445564b0dcff6c1228b57f7060de399696fd19d2 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 8 May 2011 18:37:26 +0000 Subject: [PATCH] a few more PRVM_EDICTFIELDVALUE/PRVM_GLOBALFIELDVALUE uses fixed git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11129 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=ab5ec6e843efaaa298f6661cf398ac9ed79f61b0 --- gl_rmain.c | 4 ++-- prvm_exec.c | 12 ++++++------ sv_user.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index b7364fec..996fd2d9 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -7046,9 +7046,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); diff --git a/prvm_exec.c b/prvm_exec.c index 6deb4d95..d53b2139 100644 --- a/prvm_exec.c +++ b/prvm_exec.c @@ -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); } diff --git a/sv_user.c b/sv_user.c index f8b666ad..4a70f1a6 100644 --- 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; -- 2.39.2