- wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
- wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
- make
- - EXPECT=0a08daa9132d147f533776deda07643e
+ - EXPECT=ed9be8d1b1a544f89bcdd7d36876fede
- HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
| tee /dev/stderr
| grep '^:'
// RegisterPlayer(o);
//playerchecker will do this for us later, if it has not already done so
- int sf, lf;
- sf = ReadShort();
- lf = ReadShort();
+ int sf = ReadShort();
+ int lf = ReadShort();
FOREACH(Scores, true, {
- int p = 1 << (i % 16);
+ int p = 1 << (i % 16);
if (sf & p)
{
if (lf & p)
else
o.(scores(it)) = ReadChar();
}
- });
+ });
return = true;
{
make_pure(this);
int i;
- entity o;
this.team = ReadByte();
- o = this.owner = GetTeam(this.team, true); // these team numbers can always be trusted
+ entity o = this.owner = GetTeam(this.team, true); // these team numbers can always be trusted
- int sf, lf;
#if MAX_TEAMSCORE <= 8
- sf = ReadByte();
- lf = ReadByte();
+ int sf = ReadByte();
+ int lf = ReadByte();
#else
- sf = ReadShort();
- lf = ReadShort();
+ int sf = ReadShort();
+ int lf = ReadShort();
#endif
- int p;
- for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
- if(sf & p)
+ for(i = 0; i < MAX_TEAMSCORE; ++i)
+ if(sf & BIT(i))
{
- if(lf & p)
+ if(lf & BIT(i))
o.(teamscores(i)) = ReadInt24_t();
else
o.(teamscores(i)) = ReadChar();
make_pure(this);
float newspectatee_status;
- int f = ReadByte();
+ int f = ReadByte();
scoreboard_showscores_force = (f & BIT(0));
NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew)
{
make_pure(this);
- int i, j, b, f;
+ int i, j, b, f;
- int nags = ReadByte(); // NAGS NAGS NAGS NAGS NAGS NAGS NADZ NAGS NAGS NAGS
+ int nags = ReadByte(); // NAGS NAGS NAGS NAGS NAGS NAGS NADZ NAGS NAGS NAGS
if(!(nags & BIT(2)))
{
for(i = 1; i <= maxclients; i += 8)
{
f = ReadByte();
- for(j = i-1, b = 1; b < 256; b *= 2, ++j)
+ for(j = i-1, b = BIT(0); b < BIT(8); b <<= 1, ++j)
if (!(f & b))
if(playerslots[j])
playerslots[j].ready = 0;
NET_HANDLE(ENT_CLIENT_ELIMINATEDPLAYERS, bool isnew)
{
make_pure(this);
- int sf; serialize(byte, 0, sf);
+ int sf = 0;
+ serialize(byte, 0, sf);
if (sf & 1) {
for (int j = 0; j < maxclients; ++j) {
if (playerslots[j]) {
- playerslots[j].eliminated = 1;
+ playerslots[j].eliminated = 1;
}
- }
+ }
for (int i = 1; i <= maxclients; i += 8) {
int f = 0;
serialize(byte, 0, f);
for (int b = 0; b < 8; ++b) {
if (f & BIT(b)) continue;
- int j = i - 1 + b;
- if (playerslots[j]) {
- playerslots[j].eliminated = 0;
- }
- }
+ int j = i - 1 + b;
+ if (playerslots[j]) {
+ playerslots[j].eliminated = 0;
+ }
+ }
}
}
return true;
NET_HANDLE(ENT_CLIENT_ACCURACY, bool isnew)
{
make_pure(this);
- int sf = ReadInt24_t();
+ int sf = ReadInt24_t();
if (sf == 0) {
for (int w = 0; w <= WEP_LAST - WEP_FIRST; ++w)
weapon_accuracy[w] = -1;
int f = 1;
for (int w = 0; w <= WEP_LAST - WEP_FIRST; ++w) {
if (sf & f) {
- int b = ReadByte();
+ int b = ReadByte();
if (b == 0)
weapon_accuracy[w] = -1;
else if (b == 255)
int i;
if ( mv_num_maps < 24 )
{
- int mask, power;
+ int mask;
if(mv_num_maps < 8)
mask = ReadByte();
else if(mv_num_maps < 16)
else
mask = ReadLong();
- for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2)
+ for(i = 0; i < mv_num_maps; ++i)
{
- if ( mask & power )
+ if (mask & BIT(i))
mv_flags[i] |= GTV_AVAILABLE;
else
mv_flags[i] &= ~GTV_AVAILABLE;
if(it.itemdef) // is a registered item
{
Item_Show(it, -1);
+ it.scheduledrespawntime = 0;
RandomSelection_AddEnt(it, it.cnt, 0);
}
});
{
for (i = 1; i <= maxclients; i += 8)
{
- for (f = 0, e = edict_num(i), b = 1; b < 256; b *= 2, e = nextent(e))
- if (!IS_REAL_CLIENT(e) || e.ready) f |= b;
+ for (f = 0, e = edict_num(i), b = BIT(0); b < BIT(8); b <<= 1, e = nextent(e))
+ if (!IS_REAL_CLIENT(e) || e.ready)
+ f |= b;
WriteByte(MSG_ENTITY, f);
}
}
serialize(byte, out, sendflags);
if (sendflags & 1) {
for (int i = 1; i <= maxclients; i += 8) {
- int f = 0;
- entity e = edict_num(i);
+ int f = 0;
+ entity e = edict_num(i);
for (int b = 0; b < 8; ++b, e = nextent(e)) {
if (eliminatedPlayers.isEliminated(e)) {
f |= BIT(b);
bool TeamScore_SendEntity(entity this, entity to, float sendflags)
{
- float i, p, longflags;
+ float i, longflags;
WriteHeader(MSG_ENTITY, ENT_CLIENT_TEAMSCORES);
int t = this.team - 1;
WriteByte(MSG_ENTITY, t);
longflags = 0;
- for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
+ for(i = 0; i < MAX_TEAMSCORE; ++i)
if(this.(teamscores(i)) > 127 || this.(teamscores(i)) <= -128)
- longflags |= p;
+ longflags |= BIT(i);
#if MAX_TEAMSCORE <= 8
WriteByte(MSG_ENTITY, sendflags);
WriteShort(MSG_ENTITY, sendflags);
WriteShort(MSG_ENTITY, longflags);
#endif
- for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
- if(sendflags & p)
+ for(i = 0; i < MAX_TEAMSCORE; ++i)
+ if(sendflags & BIT(i))
{
- if(longflags & p)
+ if(longflags & BIT(i))
WriteInt24_t(MSG_ENTITY, this.(teamscores(i)));
else
WriteChar(MSG_ENTITY, this.(teamscores(i)));
int done = 0; for (int i = 0, n = numentityfields(); i < n; ++i) {
string k = entityfieldname(i); vector v = (k == "mins") ? mi_min : (k == "maxs") ? mi_max : '0 0 0';
if (v) {
- putentityfieldstring(i, world, sprintf("%d %d %d", v));
+ putentityfieldstring(i, world, sprintf("%v", v));
if (++done == 2) break;
}
}