.float has_team;
float SetTeam(entity o, int Team)
{
+ assert_once(Team);
entity tm;
if(teamplay)
{
for(i = 0; i < maxclients; ++i)
{
e = playerslots[i];
- if(GetPlayerName(i) == "")
+ if(entcs_GetName(i) == "")
{
if(e.sort_prev)
{
e.ping_packetloss = 0;
e.ping_movementloss = 0;
//e.gotscores = 0; // we might already have the scores...
- SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with HUD_UpdatePlayerTeams
+ int t = entcs_GetScoreTeam(i);
+ if (t) SetTeam(e, t); // will not hurt; later updates come with HUD_UpdatePlayerTeams
RegisterPlayer(e);
HUD_UpdatePlayerPos(e);
}
// --------------------------------------------------------------------------
// BEGIN OPTIONAL CSQC FUNCTIONS
-void Ent_RemoveEntCS()
-{
- SELFPARAM();
- entcs_receiver[this.sv_entnum] = NULL;
-}
-
-NET_HANDLE(ENT_CLIENT_ENTCS, bool isnew)
-{
- make_pure(this);
- this.classname = "entcs_receiver";
- InterpolateOrigin_Undo();
- int sf = ReadByte();
-
- if(sf & BIT(0))
- this.sv_entnum = ReadByte();
- if (sf & BIT(1))
- {
- this.origin_x = ReadShort();
- this.origin_y = ReadShort();
- this.origin_z = ReadShort();
- setorigin(this, this.origin);
- }
- if (sf & BIT(2))
- {
- this.angles_y = ReadByte() * 360.0 / 256;
- this.angles_x = this.angles_z = 0;
- }
- if (sf & BIT(3))
- this.healthvalue = ReadByte() * 10;
- if (sf & BIT(4))
- this.armorvalue = ReadByte() * 10;
-
- return = true;
-
- entcs_receiver[this.sv_entnum] = this;
- this.entremove = Ent_RemoveEntCS;
- this.iflags |= IFLAG_ORIGIN;
-
- InterpolateOrigin_Note();
-}
-
void Ent_Remove();
void Ent_RemovePlayerScore()
if(!isNew && n != this.sv_entnum)
{
//print("A CSQC entity changed its owner!\n");
- LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", num_for_edict(this), this.classname);
+ LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", etof(this), this.classname);
isNew = true;
Ent_Remove();
}
if(is_new)
{
- float teamnum = GetPlayerColor(entnum - 1);
+ float teamnum = entcs_GetTeam(entnum - 1);
if(autocvar_cl_spawn_event_particles)
{
else
{
serverprevtime = time;
- serverdeltatime = getstatf(STAT_MOVEVARS_TICRATE) * getstatf(STAT_MOVEVARS_TIMESCALE);
+ serverdeltatime = STAT(MOVEVARS_TICRATE) * STAT(MOVEVARS_TIMESCALE);
time = serverprevtime + serverdeltatime;
}
{
if (t != this.enttype || isnew)
{
- LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(this), this.entnum, this.enttype, t);
+ LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", etof(this), this.entnum, this.enttype, t);
Ent_Remove();
clearentity(this);
isnew = true;
{
if (!isnew)
{
- LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(this), this.entnum, t);
+ LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", etof(this), this.entnum, t);
isnew = true;
}
}
armorblockpercent = ReadByte() / 255.0;
- g_balance_mortar_bouncefactor = ReadCoord();
- g_balance_mortar_bouncestop = ReadCoord();
- g_balance_electro_secondary_bouncefactor = ReadCoord();
- g_balance_electro_secondary_bouncestop = ReadCoord();
-
- vortex_scope = !ReadByte();
- rifle_scope = !ReadByte();
-
serverflags = ReadByte();
- minelayer_maxmines = ReadByte();
-
- hagar_maxrockets = ReadByte();
-
g_trueaim_minrange = ReadCoord();
- g_balance_porto_secondary = ReadByte();
+
return = true;
MUTATOR_CALLHOOK(Ent_Init);
strunzone(grecordholder[pos-1]);
grecordholder[pos-1] = strzone(ReadString());
grecordtime[pos-1] = ReadInt24_t();
- if(grecordholder[pos-1] == GetPlayerName(player_localnum))
+ if(grecordholder[pos-1] == entcs_GetName(player_localnum))
race_myrank = pos;
break;
case RACE_NET_SERVER_STATUS:
{
complain_weapon = ReadByte();
if (complain_weapon_name) strunzone(complain_weapon_name);
- complain_weapon_name = strzone(WEP_NAME(complain_weapon));
+ complain_weapon_name = strzone(Weapons_from(complain_weapon).m_name);
complain_weapon_type = ReadByte();
return = true;