40 #define DP_CSQC_ENTITY_REMOVE_IS_B0RKED 50 LOG_TRACEF(
"^4CSQC Build information: ^1%s", WATERMARK);
56 if (getplayerkeyvalue(i,
"viewentity") ==
"")
61 ReplicateVars(REPLICATEVARS_SEND_ALL);
98 registercvar(
"cl_weapon_switch_fallback_to_impulse",
"1");
128 get_mi_min_max_texcoords(1);
139 get_mi_min_max_texcoords(0);
181 localcmd(
"\n_cl_hook_gamestart nop\n");
193 ReplicateVars(REPLICATEVARS_DESTROY);
202 for(e = prev.sort_next; e; prev = e, e = e.sort_next)
204 if(prev != e.sort_prev)
205 error(
strcat(
"sort list chain error\nplease submit the output of 'prvm_edicts client' to the developers"));
209 for(e = prev.sort_next; e; prev = e, e = e.sort_next)
211 if(prev != e.sort_prev)
212 error(
strcat(
"sort list chain error\nplease submit the output of 'prvm_edicts client' to the developers"));
220 for(pl =
players.sort_next; pl; pl = pl.sort_next)
222 error(
"Player already registered!");
223 player.sort_next =
players.sort_next;
226 players.sort_next.sort_prev = player;
237 for(pl =
players.sort_next; pl && pl != player; pl = pl.sort_next)
242 error(
"Trying to remove a player which is not in the playerlist!");
245 parent.sort_next = player.sort_next;
247 player.sort_next.sort_prev =
parent;
268 for(tm =
teams.sort_next; tm; tm = tm.sort_next)
270 error(
"Team already registered!");
271 Team.sort_next =
teams.sort_next;
272 Team.sort_prev =
teams;
274 teams.sort_next.sort_prev = Team;
275 teams.sort_next = Team;
287 for(tm =
teams.sort_next; tm && tm != Team; tm = tm.sort_next)
292 LOG_INFO(_(
"Trying to remove a team which is not in the teamlist!"));
295 parent.sort_next = Team.sort_next;
297 Team.sort_next.sort_prev =
parent;
305 TC(
int, Team);
TC(
bool, add);
337 LOG_TRACEF(
"trying to switch to unsupported team %d", Team);
353 LOG_TRACEF(
"trying to switch to unsupported team %d", Team);
379 else if(Team != o.team)
399 if(entcs_GetName(i) ==
"")
421 e.ping_packetloss = 0;
422 e.ping_movementloss = 0;
424 int t = entcs_GetScoreTeam(i);
438 playerchecker.nextthink =
time + 0.2;
455 bool override =
false;
487 this.
owner.gotscores = 0;
489 this.
owner.(scores(it)) = 0;
501 bool isNew = !this.
owner;
502 int n = ReadByte()-1;
504 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED 529 int sf = ReadShort();
530 int lf = ReadShort();
532 int p = 1 << (i % 16);
536 o.(scores(it)) = ReadInt24_t();
538 o.(scores(it)) = ReadChar();
555 this.
team = ReadByte();
558 #if MAX_TEAMSCORE <= 8 562 int sf = ReadShort();
563 int lf = ReadShort();
569 o.(teamscores(i)) = ReadInt24_t();
571 o.(teamscores(i)) = ReadChar();
582 float newspectatee_status;
590 newspectatee_status = ReadByte();
592 newspectatee_status = -1;
595 newspectatee_status = 0;
609 for(i = 0; i < limit; ++i)
651 int nags = ReadByte();
684 for(j = i-1, b =
BIT(0); b <
BIT(8); b <<= 1, ++j)
714 for (
int b = 0; b < 8; ++b) {
715 if (f &
BIT(b))
continue;
730 float s = ReadShort();
738 int sf = ReadInt24_t();
756 f = (f == 0x800000) ? 1 : f * 2;
776 float teamnum = (ReadByte() - 1);
777 vector spn_origin = ReadVector();
779 this.
team = (teamnum + 1);
784 setsize(
this, PL_MIN_CONST, PL_MAX_CONST);
811 float entnum = ReadByte();
815 this.
origin = ReadVector();
819 float teamnum = entcs_GetTeam(entnum - 1);
867 float savetime =
time;
879 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED 882 if (t != this.
enttype || isnew)
884 LOG_INFOF(
"A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)",
etof(
this), this.
entnum, this.
enttype, t);
895 LOG_INFOF(
"A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)",
etof(
this), this.
entnum, t);
902 FOREACH(LinkedEntities, it.m_id == t, {
903 if (isnew) this.classname = it.netname;
904 if (autocvar_developer_csqcentities)
905 LOG_INFOF(
"CSQC_Ent_Update(%i, %d) at %f {.entnum=%d, .enttype=%d} t=%s (%d)", this, isnew, savetime, this.entnum, this.enttype, this.classname, t);
906 done = it.m_read(this, NULL, isnew);
907 MUTATOR_CALLHOOK(Ent_Update, this, isnew);
922 if(this.entremove) this.entremove(
this);
948 LOG_WARN(
"CSQC_Ent_Remove called for already removed entity. Packet loss?");
990 int nTEID = ReadByte();
992 FOREACH(TempEntities, it.m_id == nTEID, {
993 if (autocvar_developer_csqcentities)
994 LOG_INFOF(
"CSQC_Parse_TempEntity() nTEID=%s (%d)", it.netname, nTEID);
995 return it.m_read(NULL, NULL, true);
999 LOG_INFOF(
"CSQC_Parse_TempEntity() with nTEID=%d", nTEID);
1069 case 2:
return 0.0254;
1070 case 3:
return 0.0254 * 3.6;
1071 case 4:
return 0.0254 * 3.6 * 0.6213711922;
1072 case 5:
return 0.0254 * 1.943844492;
1082 case 1:
return strcat(
" ", _(
"qu/s"));
1083 case 2:
return strcat(
" ", _(
"m/s"));
1084 case 3:
return strcat(
" ", _(
"km/h"));
1085 case 4:
return strcat(
" ", _(
"mph"));
1086 case 5:
return strcat(
" ", _(
"knots"));
1153 int who = ReadByte();
1167 int what = ReadByte();
1179 if (reason ==
"missing a checkpoint")
1180 reason = _(
"missing a checkpoint");
1202 int pos = ReadShort();
1203 prevpos = ReadShort();
1210 for (i=m-1; i>pos-1; --i) {
1260 int pi = ReadShort();
1261 int pl = ReadByte();
1262 int ml = ReadByte();
1267 e.ping_packetloss = pl / 255.0;
1268 e.ping_movementloss = ml / 255.0;
1273 int weapon_id = ReadByte();
1292 float n, j, k, l = 0;
1300 bool joy_active =
cvar(
"joy_active");
1301 n =
tokenize(findkeysforcommand(command, 0));
1302 for(j = 0; j < n; ++j)
1308 if(!joy_active &&
substring(key, 0, 3) ==
"JOY")
1316 keys =
strcat(keys,
", ", key);
1329 if (keys ==
"NO_KEY") {
1331 return sprintf(_(
"%s (not bound)"), cmd_name);
1336 return sprintf(
"%s (%s)", cmd_name, keys);
1344 TC(
int,
id);
TC(
int, status);
1360 LOG_INFOF(
"Received HTTP request data for an invalid id %d.",
id);
entity EFFECT_SPAWNPOINT(int teamid)
string MapInfo_Type_ToString(Gametype t)
void Scoreboard_InitScores()
const int RACE_NET_CHECKPOINT_HIT_QUALIFYING
ERASEABLE int db_create()
ERASEABLE void db_put(int db, string key, string value)
#define draw_endBoldFont()
NET_HANDLE(ENT_CLIENT_SCORES, bool isnew)
void RemoveTeam(entity Team)
float race_mycheckpointdelta
float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary)
bool CSQC_Parse_TempEntity()
ERASEABLE entity Sort_Spawn()
ERASEABLE int db_load(string filename)
float RegisterPlayer(entity player)
float _MapInfo_GetTeamPlayBool(Gametype t)
bool autocvar_hud_showbinds_limit
float autocvar_cl_jetpack_attenuation
float RegisterTeam(entity Team)
void Curl_URI_Get_Callback(int id, float status, string data)
const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING
bool autocvar_hud_panel_healtharmor_progressbar_gfx
void Ent_RemovePlayerScore(entity this)
#define REGISTRY_GET(id, i)
float race_othercheckpointdelta
void CSQC_Parse_Print(string strMessage)
vector hook_shotorigin[4]
#define static_init_precache()
const int RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING
ERASEABLE void db_close(int db)
float hud_dynamic_shake_factor
void MoveToLast(entity e)
string sourceLoc
Location entity was spawned from in source.
void HUD_MinigameMenu_Close(entity this, entity actor, entity trigger)
void CSQC_Parse_CenterPrint(string strMessage)
const int RACE_NET_SPEED_AWARD
ERASEABLE float url_URI_Get_Callback(int id, float status, string data)
float race_nextcheckpoint
float autocvar_cl_spawn_point_dist_max
float scoreboard_showscores_force
vector decompressShotOrigin(int f)
const int RACE_NET_SERVER_RECORD
const int RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT
#define assert_once(expr,...)
bool autocvar_cl_lockview
float grecordtime[RANKINGS_CNT]
float race_previousbesttime
#define teamscores_label(i)
const int RACE_NET_CHECKPOINT_HIT_RACE
void CSQC_Parse_StuffCmd(string strMessage)
void LoadMenuSkinValues()
void deactivate_minigame()
string race_speedaward_alltimebest_holder
const int URI_GET_DISCARD
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
string grecordholder[RANKINGS_CNT]
string _getcommandkey(string cmd_name, string command, bool forcename)
float GetSpeedUnitFactor(int speed_unit)
const int RACE_NET_RANKINGS_CNT
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
const int RACE_NET_SERVER_RANKINGS
float complain_weapon_time
float MapVote_InputEvent(int bInputType, float nPrimary, float nSecondary)
void ConsoleCommand_macro_init()
void clearentity(entity e)
#define serialize(T, stream,...)
bool ready_waiting_for_me
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
void CSQC_Ent_Remove(entity this)
bool autocvar_cl_spawn_event_sound
ERASEABLE string ColorTranslateRGB(string s)
float damagepush_speedfactor
float race_othercheckpointlapsdelta
void CSQC_Ent_Update(entity this, bool isnew)
ERASEABLE void db_save(int db, string filename)
ERASEABLE void db_dump(int db, string filename)
bool autocvar_cl_orthoview
#define SORT_SWAP(a, b)
Swap two neighbours in a sortlist.
float chase_active_backup
const int RACE_NET_PENALTY_QUALIFYING
const int RACE_NET_SPEED_AWARD_BEST
void Scoreboard_UpdatePlayerPos(entity player)
const int RACE_NET_SERVER_STATUS
bool autocvar_cl_unpress_zoom_on_spawn
ERASEABLE string db_get(int db, string key)
void psrandom(float seed)
int autocvar_hud_panel_physics_speed_unit
#define scores_flags(this)
float race_mycheckpointtime
float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary)
#define ReadRegistered(r)
void HUD_ModIcons_SetFunc()
vector(float skel, float bonenum) _skel_get_boneabs_hidden
bool autocvar_cl_race_cptimes_onlyself
void Ent_Remove(entity this)
float race_checkpointtime
bool autocvar_r_drawviewmodel
float CSQC_InputEvent(int bInputType, float nPrimary, float nSecondary)
#define scores_label(this)
bool SetTeam(entity o, int Team)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
const int URI_GET_CURL_END
void ONREMOVE(entity this)
void Spawn_Draw(entity this)
bool autocvar_cl_orthoview_nofog
float autocvar_cl_spawnzoom_factor
string GetSpeedUnit(int speed_unit)
const int RACE_NET_PENALTY_RACE
#define MUTATOR_CALLHOOK(id,...)
float spectatee_status_changed_time
string race_previousbestname
float race_othercheckpoint
float race_mycheckpointlapsdelta
void Playerchecker_Think(entity this)
#define new_pure(class)
purely logical entities (.origin doesn't work)
string race_penaltyreason
bool autocvar_cl_spawn_event_particles
float race_othercheckpointtime
float HUD_Panel_Chat_InputEvent(float bInputType, float nPrimary, float nSecondary)
float race_penaltyeventtime
float race_mypreviousbesttime
void Local_Notification(MSG net_type, Notification net_name,...count)
void centerprint_AddStandard(string strMessage)
int autocvar_chase_active
bool autocvar_cl_spawn_point_particles
#define sound(e, c, s, v, a)
#define teamscores_flags(i)
float RANKINGS_DISPLAY_CNT
void HUD_Radar_Hide_Maximized()
bool autocvar_developer_csqcentities
void Scoreboard_UpdateTeamPos(entity Team)
string race_mycheckpointenemy
int spectatorlist[MAX_SPECTATORS]
bool autocvar_cl_db_saveasdump
string translate_key(string key)
float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
float race_penaltyaccumulator
bool autocvar_cl_spawnzoom
#define FOREACH(list, cond, body)
const int RACE_NET_CHECKPOINT_CLEAR
int weapon_accuracy[REGISTRY_MAX(Weapons)]
IntrusiveList g_drawables
#define static_init_late()
entity GetTeam(int Team, bool add)
string race_othercheckpointenemy
float race_speedaward_alltimebest
bool spectatorbutton_zoom
void URI_Get_Callback(int id, int status, string data)
engine callback
void RemovePlayer(entity player)
bool autocvar_hud_showbinds
string race_speedaward_holder