mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 14:20:59 +00:00
Hipnotic/Rogue weapon mask comments and cleanup.
This too has been sitting around for a while. Taken from fitzquake.
This commit is contained in:
parent
d32fa834cc
commit
60c9d05d47
2 changed files with 9 additions and 1 deletions
|
@ -792,6 +792,7 @@ CL_ParseClientdata (void)
|
||||||
Sbar_Changed ();
|
Sbar_Changed ();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// hipnotic/rogue weapon "bit field" (stupid idea)
|
||||||
if (cl.stats[STAT_ACTIVEWEAPON] != (1 << i)) {
|
if (cl.stats[STAT_ACTIVEWEAPON] != (1 << i)) {
|
||||||
cl.stats[STAT_ACTIVEWEAPON] = (1 << i);
|
cl.stats[STAT_ACTIVEWEAPON] = (1 << i);
|
||||||
Sbar_Changed ();
|
Sbar_Changed ();
|
||||||
|
|
|
@ -747,8 +747,15 @@ SV_WriteClientdataToMessage (edict_t *ent, sizebuf_t *msg)
|
||||||
if (standard_quake) {
|
if (standard_quake) {
|
||||||
MSG_WriteByte (msg, SVfloat (ent, weapon));
|
MSG_WriteByte (msg, SVfloat (ent, weapon));
|
||||||
} else {
|
} else {
|
||||||
|
// NOTE: this is abysmally stupid. weapon is being treated as a
|
||||||
|
// radio button style bit mask, limiting the available weapons to
|
||||||
|
// 32. Sure, that's a lot of weapons, but still...
|
||||||
|
//
|
||||||
|
// Send the index of the lowest order set bit.
|
||||||
|
unsigned weapon;
|
||||||
|
weapon = (unsigned) SVfloat (ent, weapon);
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
if (((int) SVfloat (ent, weapon)) & (1 << i)) {
|
if (weapon & (1 << i)) {
|
||||||
MSG_WriteByte (msg, i);
|
MSG_WriteByte (msg, i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue