From: Mario Date: Sun, 18 Oct 2015 01:39:01 +0000 (+1000) Subject: Add some extra mutator hooks to change the persistently saved floats X-Git-Tag: xonotic-v0.8.2~1811 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5a0ea6cd1963a0888ba796b20cece23d91ac8791;p=xonotic%2Fxonotic-data.pk3dir.git Add some extra mutator hooks to change the persistently saved floats --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index c608c5b2c..057771b7b 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -749,6 +749,8 @@ void SetNewParms (void) { // initialize parms for a new player parm1 = -(86400 * 366); + + MUTATOR_CALLHOOK(SetNewParms); } /* @@ -760,6 +762,8 @@ void SetChangeParms (void) {SELFPARAM(); // save parms for level change parm1 = self.parm_idlesince - time; + + MUTATOR_CALLHOOK(SetChangeParms); } /* @@ -776,6 +780,8 @@ void DecodeLevelParms (void) // whatever happens, allow 60 seconds of idling directly after connect for map loading self.parm_idlesince = max(self.parm_idlesince, time - sv_maxidle + 60); + + MUTATOR_CALLHOOK(DecodeLevelParms); } /* diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 1492b9f6a..f2d690ff5 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -635,4 +635,10 @@ MUTATOR_HOOKABLE(BuffModel_Customize, EV_BuffModel_Customize); /** player */ i(entity, other) \ /**/ MUTATOR_HOOKABLE(BuffTouch, EV_BuffTouch); + +MUTATOR_HOOKABLE(SetNewParms, EV_NO_ARGS); + +MUTATOR_HOOKABLE(SetChangeParms, EV_NO_ARGS); + +MUTATOR_HOOKABLE(DecodeLevelParms, EV_NO_ARGS); #endif