e = edict_num(self.cnt + 1);
if(IS_REAL_CLIENT(e))
{
- WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte(MSG_BROADCAST, TE_CSQC_PINGPLREPORT);
+ WriteHeader(MSG_BROADCAST, TE_CSQC_PINGPLREPORT);
WriteByte(MSG_BROADCAST, self.cnt);
WriteShort(MSG_BROADCAST, max(1, e.ping));
WriteByte(MSG_BROADCAST, ceil(e.ping_packetloss * 255));
}
else
{
- WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte(MSG_BROADCAST, TE_CSQC_PINGPLREPORT);
+ WriteHeader(MSG_BROADCAST, TE_CSQC_PINGPLREPORT);
WriteByte(MSG_BROADCAST, self.cnt);
WriteShort(MSG_BROADCAST, 0);
WriteByte(MSG_BROADCAST, 0);
}
void PingPLReport_Spawn()
{
- pingplreport = spawn();
- pingplreport.classname = "pingplreport";
+ pingplreport = new(pingplreport);
+ make_pure(pingplreport);
pingplreport.think = PingPLReport_Think;
pingplreport.nextthink = time;
}
entity randomseed;
bool RandomSeed_Send(entity this, entity to, int sf)
{
- WriteByte(MSG_ENTITY, ENT_CLIENT_RANDOMSEED);
+ WriteHeader(MSG_ENTITY, ENT_CLIENT_RANDOMSEED);
WriteShort(MSG_ENTITY, self.cnt);
return true;
}
}
void RandomSeed_Spawn()
{SELFPARAM();
- randomseed = spawn();
+ randomseed = new(randomseed);
+ make_pure(randomseed);
randomseed.think = RandomSeed_Think;
Net_LinkEntity(randomseed, false, 0, RandomSeed_Send);
remove = remove_unsafely;
- entity e;
- e = spawn();
+ entity e = spawn();
e.think = GotoFirstMap;
e.nextthink = time; // this is usually 1 at this point
- e = spawn();
- e.classname = "info_player_deathmatch"; // safeguard against player joining
+ e = new(info_player_deathmatch); // safeguard against player joining
self.classname = "worldspawn"; // safeguard against various stuff ;)
// needs to be done so early because of the constants they create
static_init();
static_init_late();
+ static_init_precache();
MapInfo_Enumerate();
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
InitGameplayMode();
static_init_late();
+ static_init_precache();
readlevelcvars();
GrappleHookInit();
e.solid = SOLID_NOT;
e.movetype = MOVETYPE_NONE;
e.takedamage = DAMAGE_NO;
- if(e.weaponentity)
+ for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
- e.weaponentity.effects = EF_NODRAW;
- if (e.weaponentity.weaponentity)
- e.weaponentity.weaponentity.effects = EF_NODRAW;
+ .entity weaponentity = weaponentities[slot];
+ if(e.(weaponentity))
+ {
+ e.(weaponentity).effects = EF_NODRAW;
+ if (e.(weaponentity).(weaponentity))
+ e.(weaponentity).(weaponentity).effects = EF_NODRAW;
+ }
}
if(IS_REAL_CLIENT(e))
{