From: havoc Date: Sun, 8 May 2011 18:37:26 +0000 (+0000) Subject: a few more PRVM_EDICTFIELDVALUE/PRVM_GLOBALFIELDVALUE uses fixed X-Git-Tag: xonotic-v0.6.0~163^2~417 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=ab5ec6e843efaaa298f6661cf398ac9ed79f61b0 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 --- diff --git a/gl_rmain.c b/gl_rmain.c index 8f9b3ec5..81ada172 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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); 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;