// Init all cg_entities ptrs int entityCount = 0; for (; entityCount < MAX_GENTITIES; entityCount++) { DWORD offset = (DWORD) nex.mod->cg_entities + (entityCount * nex.mod->centity_t_size); nex.cg_entities[entityCount].currentState = (entityState_t *) (offset + CG_ENTITIES_CURRENTSTATE_OFFSET); nex.cg_entities[entityCount].currentValid = (qboolean *) (offset + CG_ENTITIES_CURRENTVALID_OFFSET); }