#include "hud/all.qh"
#include "mapvoting.qh"
#include "mutators/events.qh"
-#include "quickmenu.qh"
+#include "hud/panel/quickmenu.qh"
#include "scoreboard.qh"
#include "shownames.qh"
#include <common/t_items.qh>
registercvar("cl_jumpspeedcap_min", "");
registercvar("cl_jumpspeedcap_max", "");
- registercvar("cl_multijump", "0");
+ registercvar("cl_multijump", "1");
registercvar("cl_spawn_near_teammate", "1");
}
deactivate_minigame();
- HUD_MinigameMenu_Close();
+ HUD_MinigameMenu_Close(NULL, NULL, NULL);
}
.float has_team;
float SetTeam(entity o, int Team)
{
+ TC(int, Team);
devassert_once(Team);
entity tm;
if(teamplay)
case NUM_TEAM_4:
break;
default:
- if(GetTeam(Team, false) == world)
+ if(GetTeam(Team, false) == NULL)
{
LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
Team = NUM_SPECTATOR;
case 0:
break;
default:
- if(GetTeam(Team, false) == world)
+ if(GetTeam(Team, false) == NULL)
{
LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
Team = NUM_SPECTATOR;
return false;
}
-void Playerchecker_Think()
+void Playerchecker_Think(entity this)
{
- SELFPARAM();
int i;
entity e;
for(i = 0; i < maxclients; ++i)
// player disconnected
SetTeam(e, -1);
RemovePlayer(e);
- e.sort_prev = world;
+ e.sort_prev = NULL;
//e.gotscores = 0;
}
}
// player connected
if (!e)
{
- playerslots[i] = e = new(playerslot);
- make_pure(e);
+ playerslots[i] = e = new_pure(playerslot);
}
e.sv_entnum = i;
e.ping = 0;
this.nextthink = time + 0.2;
}
-void Porto_Init();
void TrueAim_Init();
void PostInit()
{
- entity playerchecker = new(playerchecker);
- make_pure(playerchecker);
- playerchecker.think = Playerchecker_Think;
+ entity playerchecker = new_pure(playerchecker);
+ setthink(playerchecker, Playerchecker_Think);
playerchecker.nextthink = time + 0.2;
- Porto_Init();
TrueAim_Init();
postinit = true;
// In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
// In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
// In the case of mouse input after a setcursormode(1) call, nPrimary is xpos, nSecondary is ypos.
-float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
+float CSQC_InputEvent(int bInputType, float nPrimary, float nSecondary)
{
+ TC(int, bInputType);
if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary))
return true;
// --------------------------------------------------------------------------
// BEGIN OPTIONAL CSQC FUNCTIONS
-.void(entity) predraw_qc;
-void PreDraw_self()
-{
- SELFPARAM();
- if (this.predraw_qc) this.predraw_qc(this);
-}
-
-void setpredraw(entity this, void(entity) pdfunc)
-{
- this.predraw = PreDraw_self;
- this.predraw_qc = pdfunc;
-}
-
void Ent_Remove(entity this);
void Ent_RemovePlayerScore(entity this)
o = playerslots[this.sv_entnum];
if (!o)
{
- o = playerslots[this.sv_entnum] = new(playerslot);
- make_pure(o);
+ o = playerslots[this.sv_entnum] = new_pure(playerslot);
}
this.owner = o;
o.sv_entnum = this.sv_entnum;
// clear race stuff
race_laptime = 0;
race_checkpointtime = 0;
+ hud_dynamic_shake_factor = -1;
}
if (autocvar_hud_panel_healtharmor_progressbar_gfx)
{
// CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
// The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
void CSQC_Ent_Update(bool isnew)
-{
- SELFPARAM();
+{ENGINE_EVENT();
this.sourceLoc = __FILE__ ":" STR(__LINE__);
int t = ReadByte();
#endif
this.enttype = t;
bool done = false;
- FOREACH(LinkedEntities, it.m_id == t, LAMBDA(
+ FOREACH(LinkedEntities, it.m_id == t, {
if (isnew) this.classname = it.netname;
if (autocvar_developer_csqcentities)
LOG_INFOF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
done = it.m_read(this, NULL, isnew);
break;
- ));
+ });
time = savetime;
if (!done)
{
}
// CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed. Essentially call remove(this) as well.
void CSQC_Ent_Remove()
-{
- SELFPARAM();
+{ENGINE_EVENT();
if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Ent_Remove() with this=%i {.entnum=%d, .enttype=%d}\n", this, this.entnum, this.enttype);
if (wasfreed(this))
{
// Acquire TE ID
int nTEID = ReadByte();
- FOREACH(TempEntities, it.m_id == nTEID, LAMBDA(
+ FOREACH(TempEntities, it.m_id == nTEID, {
if (autocvar_developer_csqcentities)
LOG_INFOF("CSQC_Parse_TempEntity() nTEID=%s (%d)\n", it.netname, nTEID);
return it.m_read(NULL, NULL, true);
- ));
+ });
if (autocvar_developer_csqcentities)
LOG_INFOF("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
keys = db_get(binddb, command);
if (keys == "")
{
+ bool joy_detected = cvar("joy_detected");
n = tokenize(findkeysforcommand(command, 0)); // uses '...' strings
for(j = 0; j < n; ++j)
{
k = stof(argv(j));
if(k != -1)
{
- if ("" == keys)
- keys = keynumtostring(k);
+ string key = keynumtostring(k);
+ if(!joy_detected && substring(key, 0, 3) == "JOY")
+ continue;
+
+ if (keys == "")
+ keys = key;
else
- keys = strcat(keys, ", ", keynumtostring(k));
+ keys = strcat(keys, ", ", key);
++l;
if (autocvar_hud_showbinds_limit > 0 && autocvar_hud_showbinds_limit <= l)