#include <common/mapinfo.qh>
#include <common/minigames/cl_minigames.qh>
#include <common/minigames/cl_minigames_hud.qh>
+#include <common/net_linked.qh>
#include <common/net_notice.qh>
+#include <common/scores.qh>
#include <common/triggers/include.qh>
#include <common/vehicles/all.qh>
#include <lib/csqcmodel/cl_model.qh>
void draw_cursor(vector pos, vector ofs, string img, vector col, float a)
{
- ofs = eX * (ofs.x * SIZE_CURSOR.x) + eY * (ofs.y * SIZE_CURSOR.y);
+ ofs = vec2(ofs.x * SIZE_CURSOR.x, ofs.y * SIZE_CURSOR.y);
drawpic(pos - ofs, strcat(draw_currentSkin, img), SIZE_CURSOR, col, a, DRAWFLAG_NORMAL);
}
registercvar("cl_spawn_near_teammate", "1");
- gametype = NULL;
-
- // sbt_fields uses strunzone on the titles!
- for(int i = 0; i < MAX_SBT_FIELDS; ++i)
- sbt_field_title[i] = strzone("(null)");
+ if(autocvar_cl_lockview)
+ cvar_set("cl_lockview", "0");
- Cmd_Scoreboard_SetFields(0);
+ gametype = NULL;
postinit = false;
localcmd("\ncl_hook_gameend\n");
}
+ localcmd("\ncl_hook_shutdown\n");
+
deactivate_minigame();
HUD_MinigameMenu_Close(NULL, NULL, NULL);
}
spectatorbutton_zoom = (f & 4);
- if(f & 8)
- {
- angles_held_status = 1;
- angles_held.x = ReadAngle();
- angles_held.y = ReadAngle();
- angles_held.z = 0;
- }
- else
- angles_held_status = 0;
-
if(f & 16)
{
num_spectators = ReadByte();
{
if(vote_called_vote)
strunzone(vote_called_vote);
- vote_called_vote = strzone(ColorTranslateRGB(ReadString()));
+ vote_called_vote = strzone(ReadString());
}
if(nags & 1)
}*/
if(autocvar_cl_spawn_point_particles)
{
- if((serverflags & SERVERFLAG_TEAMPLAY))
+ if(teamplay)
{
switch(teamnum)
{
localcmd("-zoom\n");
button_zoom = false;
}
+ HUD_Radar_Hide_Maximized();
}
- HUD_Radar_Hide_Maximized();
//printf("Ent_ReadSpawnEvent(is_new = %d); origin = %s, entnum = %d, localentnum = %d\n", is_new, vtos(this.origin), entnum, player_localentnum);
}
if(this.snd_looping > 0)
{
- sound(this, this.snd_looping, SND_Null, VOL_BASE, autocvar_g_jetpack_attenuation);
+ sound(this, this.snd_looping, SND_Null, VOL_BASE, autocvar_cl_jetpack_attenuation);
this.snd_looping = 0;
}
{
make_pure(this);
gametype = ReadRegistered(Gametypes);
+ teamplay = _MapInfo_GetTeamPlayBool(gametype);
HUD_ModIcons_SetFunc();
FOREACH(Scores, true, {
if (scores_label(it)) strunzone(scores_label(it));
forcefog = strzone(ReadString());
armorblockpercent = ReadByte() / 255.0;
+ damagepush_speedfactor = ReadByte() / 255.0;
serverflags = ReadByte();
race_checkpoint = ReadByte();
race_time = ReadInt24_t();
race_previousbesttime = ReadInt24_t();
+ race_mypreviousbesttime = ReadInt24_t();
if(race_previousbestname)
strunzone(race_previousbestname);
- race_previousbestname = strzone(ColorTranslateRGB(ReadString()));
+ string pbestname = ReadString();
+ if(autocvar_cl_race_cptimes_onlyself)
+ {
+ race_previousbesttime = race_mypreviousbesttime;
+ race_mypreviousbesttime = 0;
+ race_previousbestname = strzone("");
+ }
+ else
+ race_previousbestname = strzone(pbestname);
race_checkpointtime = time;
race_penaltyaccumulator = 0;
race_laptime = time; // valid
}
-
break;
case RACE_NET_CHECKPOINT_CLEAR:
race_nextcheckpoint = ReadByte();
race_nextbesttime = ReadInt24_t();
+ race_mybesttime = ReadInt24_t();
if(race_nextbestname)
strunzone(race_nextbestname);
- race_nextbestname = strzone(ColorTranslateRGB(ReadString()));
+ string newname = ReadString();
+ if(autocvar_cl_race_cptimes_onlyself)
+ {
+ race_nextbesttime = race_mybesttime;
+ race_mybesttime = 0;
+ race_nextbestname = strzone("");
+ }
+ else
+ race_nextbestname = strzone(newname);
break;
case RACE_NET_CHECKPOINT_HIT_RACE:
race_mycheckpointlapsdelta -= 256;
if(race_mycheckpointenemy)
strunzone(race_mycheckpointenemy);
- race_mycheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
+ int who = ReadByte();
+ if(who)
+ race_mycheckpointenemy = strzone(entcs_GetName(who - 1));
+ else
+ race_mycheckpointenemy = strzone(""); // TODO: maybe string_null works fine here?
break;
case RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT:
race_othercheckpointlapsdelta -= 256;
if(race_othercheckpointenemy)
strunzone(race_othercheckpointenemy);
- race_othercheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
+ int what = ReadByte();
+ if(what)
+ race_othercheckpointenemy = strzone(entcs_GetName(what - 1));
+ else
+ race_othercheckpointenemy = strzone(""); // TODO: maybe string_null works fine here?
break;
case RACE_NET_PENALTY_RACE:
strunzone(grecordholder[pos-1]);
grecordholder[pos-1] = strzone(ReadString());
grecordtime[pos-1] = ReadInt24_t();
- if(grecordholder[pos-1] == entcs_GetName(player_localnum))
+ if(strdecolorize(grecordholder[pos-1]) == strdecolorize(entcs_GetName(player_localnum)))
race_myrank = pos;
break;
case RACE_NET_SERVER_STATUS:
keys = db_get(binddb, command);
if (keys == "")
{
- bool joy_detected = cvar("joy_detected");
+ bool joy_active = cvar("joy_active");
n = tokenize(findkeysforcommand(command, 0)); // uses '...' strings
for(j = 0; j < n; ++j)
{
if(k != -1)
{
string key = keynumtostring(k);
- if(!joy_detected && substring(key, 0, 3) == "JOY")
+ if(!joy_active && substring(key, 0, 3) == "JOY")
continue;
if (keys == "")