]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/LMS_improvements' into 'master'
authorMario <zacjardine@y7mail.com>
Tue, 29 Nov 2016 14:02:46 +0000 (14:02 +0000)
committerMario <zacjardine@y7mail.com>
Tue, 29 Nov 2016 14:02:46 +0000 (14:02 +0000)
LMS improvements

* Fix wrong rankings when a player quits the game (by pressing F3) or disconnects; don't allow eliminated players to quit the game
* Suppress pointless spectate warning for real spectators and eliminated players as they are actually spectating
* Add a proper warmup support: lives never decrease, rejoin after spectating is allowed. Previously game ended once everybody is ready

See merge request !394

qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/events.qh

index e4b784371525776b05566d4cb521902701dcb8e0..5f11777c2352b69d0ed4152ab1668e18dae3005b 100644 (file)
@@ -87,6 +87,8 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn)
                int tested = 0;
                FOREACH_CLIENT_RANDOM(IS_PLAYER(it), LAMBDA(
                        if (autocvar_g_spawn_near_teammate_ignore_spawnpoint_max && tested >= autocvar_g_spawn_near_teammate_ignore_spawnpoint_max) break;
+
+                       if (PHYS_INPUT_BUTTON_CHAT(it)) continue;
                        if (!SAME_TEAM(player, it)) continue;
                        if (autocvar_g_spawn_near_teammate_ignore_spawnpoint_check_health && it.health < autocvar_g_balance_health_regenstable) continue;
                        if (IS_DEAD(it)) continue;
index e90dbeb9669a81e00cc94cb6651094e015081c4d..7f4899f127faed3c1d53e77e9ad15a4d236f197b 100644 (file)
@@ -238,6 +238,9 @@ string formatmessage(entity this, string msg)
        cursor = trace_endpos;
        cursor_ent = trace_ent;
 
+       MUTATOR_CALLHOOK(PreFormatMessage, this, msg);
+       msg = M_ARGV(1, string);
+
        while (1) {
                if (n < 1)
                        break; // too many replacements
index 21c8ef9a5c114e92b0650f4ca5b6ec251a14d3a5..b6e8c7f4b7b233f38edc3bf18e5c45417db27285 100644 (file)
@@ -134,6 +134,14 @@ MUTATOR_HOOKABLE(SpectateCopy, EV_SpectateCopy);
     /**/
 MUTATOR_HOOKABLE(FormatMessage, EV_FormatMessage);
 
+/** called before any formatting is applied, handy for tweaking the message before scripts get ahold of it */
+#define EV_PreFormatMessage(i, o) \
+    /** player        */ i(entity, MUTATOR_ARGV_0_entity) \
+    /** message       */ i(string, MUTATOR_ARGV_1_string) \
+    /**/                 o(string, MUTATOR_ARGV_1_string) \
+    /**/
+MUTATOR_HOOKABLE(PreFormatMessage, EV_PreFormatMessage);
+
 /** returns true if throwing the current weapon shall not be allowed */
 #define EV_ForbidThrowCurrentWeapon(i, o) \
     /** player        */ i(entity, MUTATOR_ARGV_0_entity) \