#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "constants.qh"
#include "util.qh"
#include "weapons/all.qh"
#endif
#ifdef SVQC
-void PlayerStats_Prematch(void)
+void PlayerStats_Prematch()
{
//foobar
}
void PlayerStats_GameReport_Accuracy(entity p)
{
- int i;
-
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- entity w = get_weaponinfo(i);
-
- #define ACCMAC(suffix,field) \
- PS_GR_P_ADDVAL(p, sprintf("acc-%s-%s", w.netname, suffix), p.accuracy.(field[i-1]));
-
+ #define ACCMAC(suffix, field) \
+ PS_GR_P_ADDVAL(p, sprintf("acc-%s-%s", it.netname, suffix), p.accuracy.(field[i-1]));
+ FOREACH(Weapons, it != WEP_Null, LAMBDA(
ACCMAC("hit", accuracy_hit)
ACCMAC("fired", accuracy_fired)
ACCMAC("cnt-hit", accuracy_cnt_hit)
ACCMAC("cnt-fired", accuracy_cnt_fired)
ACCMAC("frags", accuracy_frags)
-
- #undef ACCMAC
- }
+ ));
+ #undef ACCMAC
}
void PlayerStats_GameReport_FinalizePlayer(entity p)
PlayerStats_GameReport_AddEvent(PLAYERSTATS_RANK);
// accuracy stats
- entity w;
- float i;
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- w = get_weaponinfo(i);
- PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-hit"));
- PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-fired"));
- PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-cnt-hit"));
- PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-cnt-fired"));
- PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-frags"));
- }
+ FOREACH(Weapons, it != WEP_Null, LAMBDA(
+ PlayerStats_GameReport_AddEvent(strcat("acc-", it.netname, "-hit"));
+ PlayerStats_GameReport_AddEvent(strcat("acc-", it.netname, "-fired"));
+ PlayerStats_GameReport_AddEvent(strcat("acc-", it.netname, "-cnt-hit"));
+ PlayerStats_GameReport_AddEvent(strcat("acc-", it.netname, "-cnt-fired"));
+ PlayerStats_GameReport_AddEvent(strcat("acc-", it.netname, "-frags"));
+ ));
PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3);
PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5);
LOG_TRACE("Added item ", sprintf("#%s", event), "=", data, " to PS_D_IN_DB\n");
}
-void PlayerStats_PlayerDetail(void)
+void PlayerStats_PlayerDetail()
{
// http://stats.xonotic.org/player/me
if((autocvar_g_playerstats_playerdetail_uri != "") && (crypto_getmyidstatus(0) > 0))
}
}
-void PlayerStats_PlayerDetail_CheckUpdate(void)
+void PlayerStats_PlayerDetail_CheckUpdate()
{
// determine whether we should retrieve playerdetail information again
float gamecount = cvar("cl_matchcount");