X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fclient.qc;h=74592b62cb0972217162c135cc4d68b4fc3efa72;hb=3a0c0dffe1aed299bfa6fc7b49faeab49b6138f9;hp=4e04373bd6f4ecfa0d1afb62137a4e3dd55a7536;hpb=a140d84e31546812f5ccb972f04914ee53626248;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 4e04373bd..74592b62c 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1201,6 +1201,8 @@ Called when a client disconnects from the server ============= */ .entity chatbubbleentity; +void player_powerups_remove_all(entity this); + void ClientDisconnect(entity this) { assert(IS_CLIENT(this), return); @@ -1253,6 +1255,8 @@ void ClientDisconnect(entity this) ReadyCount(); if (vote_called && IS_REAL_CLIENT(this)) VoteCount(false); + player_powerups_remove_all(this); // stop powerup sound + ONREMOVE(this); } @@ -1449,7 +1453,8 @@ void player_powerups_remove_all(entity this) { if (this.items & (ITEM_Strength.m_itemid | ITEM_Shield.m_itemid | IT_SUPERWEAPON)) { - if (time > game_starttime + 1) + // don't play the poweroff sound when the game restarts or the player disconnects + if (time > game_starttime + 1 && IS_CLIENT(this)) sound(this, CH_INFO, SND_POWEROFF, VOL_BASE, ATTEN_NORM); stopsound(this, CH_TRIGGER_SINGLE); // get rid of the pickup sound this.items &= ~ITEM_Strength.m_itemid; @@ -1715,6 +1720,7 @@ void GetPressedKeys(entity this) return; } + // NOTE: GetPressedKeys and PM_dodging_GetPressedKeys use similar code int keys = STAT(PRESSED_KEYS, this); keys = BITSET(keys, KEY_FORWARD, CS(this).movement.x > 0); keys = BITSET(keys, KEY_BACKWARD, CS(this).movement.x < 0);