From: terencehill Date: Mon, 14 Dec 2015 18:02:50 +0000 (+0100) Subject: Send item times to the client just connected to the server when he forcibly becomes... X-Git-Tag: xonotic-v0.8.2~1284^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=71cc0624f020165d5ea5b356168b47138809d87f;p=xonotic%2Fxonotic-data.pk3dir.git Send item times to the client just connected to the server when he forcibly becomes player on connection, like it happens in LMS (normally item times are sent in putObserverInServer function, but in this case this step is skipped). Fixes extralife time initially not showing up in warmup stage --- diff --git a/qcsrc/common/mutators/mutator/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime.qc index c9f6eaf77..f5a53d167 100644 --- a/qcsrc/common/mutators/mutator/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime.qc @@ -157,6 +157,17 @@ MUTATOR_HOOKFUNCTION(itemstime, MakePlayerObserver) Item_ItemsTime_SetTimesForPlayer(self); } +MUTATOR_HOOKFUNCTION(itemstime, ClientConnect, CBC_ORDER_LAST) +{SELFPARAM(); + if(IS_PLAYER(self)) + { + // client became player on connection skipping putObserverInServer step + if (IS_REAL_CLIENT(self)) + if (warmup_stage) + Item_ItemsTime_SetTimesForPlayer(self); + } +} + MUTATOR_HOOKFUNCTION(itemstime, PlayerSpawn) {SELFPARAM(); if (warmup_stage) return;