]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hook for forcing 3rd person mode
authorMario <zacjardine@y7mail.com>
Sat, 29 Aug 2015 13:30:00 +0000 (23:30 +1000)
committerMario <zacjardine@y7mail.com>
Sat, 29 Aug 2015 13:30:00 +0000 (23:30 +1000)
qcsrc/client/mutators/events.qh
qcsrc/client/view.qc

index d6ac0c88115eaaffa841e9ce80bc67eab79fb9e7..fe2e3fd33ffb6f915b06e160b171d88927ffd116 100644 (file)
@@ -123,4 +123,10 @@ float player_multijump;
 float player_jumpheight;
 MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump);
 
+/** Called checking if 3rd person mode should be forced on */
+#define EV_WantEventchase(i, o) \
+    /** entity id */ i(entity, self) \
+    /**/
+MUTATOR_HOOKABLE(WantEventchase, EV_WantEventchase);
+
 #endif
index f1a7f2234ca0f97c42bf2f42b91e467843c65e9f..56ee22254a0ade6575f702c7b6ae071bca01a7b0 100644 (file)
@@ -437,6 +437,8 @@ bool WantEventchase()
        {
                if(hud != HUD_NORMAL && (autocvar_cl_eventchase_vehicle || spectatee_status > 0))
                        return true;
+               if(MUTATOR_CALLHOOK(WantEventchase, self))
+                       return true;
                if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WepSet_FromWeapon(WEP_PORTO.m_id)))
                        return true;
                if(autocvar_cl_eventchase_death && (getstati(STAT_HEALTH) <= 0))