+ memset(stats, 0, sizeof(int[MAX_CL_STATS]));
+ stats[STAT_VIEWHEIGHT] = ent->v->view_ofs[2];
+ stats[STAT_ITEMS] = items;
+ stats[STAT_WEAPONFRAME] = ent->v->weaponframe;
+ stats[STAT_ARMOR] = ent->v->armorvalue;
+ stats[STAT_WEAPON] = weaponmodelindex;
+ stats[STAT_HEALTH] = ent->v->health;
+ stats[STAT_AMMO] = ent->v->currentammo;
+ stats[STAT_SHELLS] = ent->v->ammo_shells;
+ stats[STAT_NAILS] = ent->v->ammo_nails;
+ stats[STAT_ROCKETS] = ent->v->ammo_rockets;
+ stats[STAT_CELLS] = ent->v->ammo_cells;
+ stats[STAT_ACTIVEWEAPON] = ent->v->weapon;
+ stats[STAT_VIEWZOOM] = viewzoom;
+ // the QC bumps these itself by sending svc_'s, so we have to keep them
+ // zero or they'll be corrected by the engine
+ //stats[STAT_TOTALSECRETS] = pr_global_struct->total_secrets;
+ //stats[STAT_TOTALMONSTERS] = pr_global_struct->total_monsters;
+ //stats[STAT_SECRETS] = pr_global_struct->found_secrets;
+ //stats[STAT_MONSTERS] = pr_global_struct->killed_monsters;
+
+ if (sv.protocol != PROTOCOL_DARKPLACES6)
+ {
+ if (stats[STAT_VIEWHEIGHT] != DEFAULT_VIEWHEIGHT) bits |= SU_VIEWHEIGHT;
+ bits |= SU_ITEMS;
+ if (stats[STAT_WEAPONFRAME]) bits |= SU_WEAPONFRAME;
+ if (stats[STAT_ARMOR]) bits |= SU_ARMOR;
+ bits |= SU_WEAPON;
+ // FIXME: which protocols support this? does PROTOCOL_DARKPLACES3 support viewzoom?
+ if (sv.protocol == PROTOCOL_DARKPLACES4 || sv.protocol == PROTOCOL_DARKPLACES5)
+ if (viewzoom != 255)
+ bits |= SU_VIEWZOOM;
+ }