// walk attachments to find RENDER_EXTERIORMODEL status
{
prvm_edict_t *ent = ed;
- prvm_edict_t *v = PRVM_EDICT_NUM(CL_VM_GetViewEntity());
+ int vn = CL_VM_GetViewEntity();
int attachloop = 0;
for(;;)
{
if(attachloop >= 256)
break;
- if(ent == v)
+ if(MAX_EDICTS + PRVM_NUM_FOR_EDICT(ent) == vn)
{
entrender->flags |= RENDER_EXTERIORMODEL;
break;
int CL_VM_GetViewEntity(void)
{
if(cl.csqc_server2csqcentitynumber[cl.viewentity])
- return cl.csqc_server2csqcentitynumber[cl.viewentity];
+ return cl.csqc_server2csqcentitynumber[cl.viewentity] + MAX_EDICTS;
return cl.viewentity;
}