/**/ o(string, ret_string) \
/**/
MUTATOR_HOOKABLE(SetPlayerStatus, EV_SetPlayerStatus);
+
+#define EV_AddPlayerScore(i, o) \
+ /**/ i(int, score_field) \
+ /**/ i(float, ret_float) \
+ /**/ o(float, ret_float) \
+ /**/
+int score_field;
+MUTATOR_HOOKABLE(AddPlayerScore, EV_AddPlayerScore);
#endif
return true;
}
+MUTATOR_HOOKFUNCTION(lms, AddPlayerScore)
+{
+ if(gameover)
+ if(score_field == SP_LMS_RANK)
+ return true; // allow writing to this field in intermission as it is needed for newly joining players
+ return false;
+}
+
// scoreboard stuff
void lms_ScoreRules()
{
float PlayerScore_Add(entity player, float scorefield, float score)
{
- entity s;
+ bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score);
+ score = ret_float;
if(gameover)
- if(!(g_lms && scorefield == SP_LMS_RANK)) // allow writing to this field in intermission as it is needed for newly joining players
+ if(!mutator_returnvalue)
score = 0;
if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
- s = player.scorekeeper;
+ entity s = player.scorekeeper;
if(!s)
{
if(gameover)