From 6e5a2049535a3d4094e49dc5f7e667142133c365 Mon Sep 17 00:00:00 2001 From: Sploder12 Date: Sat, 8 Jun 2024 03:12:27 -0400 Subject: [PATCH] add quit flag comparing strings is slow and so is text rendering! (but mostly text rendering) --- src/game/controls/MPFFRScoreCompare.as | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/controls/MPFFRScoreCompare.as b/src/game/controls/MPFFRScoreCompare.as index adcd4046..80ca5598 100644 --- a/src/game/controls/MPFFRScoreCompare.as +++ b/src/game/controls/MPFFRScoreCompare.as @@ -119,6 +119,7 @@ internal class PlayerLabel extends Sprite private var _lastPosition:int = -1; private var _lastScore:int = -1; + private var _hasQuit:Boolean = false; public function PlayerLabel(room:MPRoomFFR, data:MPMatchFFRUser):void { @@ -165,12 +166,13 @@ internal class PlayerLabel extends Sprite this.alpha = data.alive ? 1 : 0.5; isAlive = data.alive; } - else { + else if (!_hasQuit) { // check if user has quit the match (but is still connected) const gameState:String = data.room.player_state_map[data.user.uid].game_state; if (gameState != "game" && gameState != "loading") { txtUsername.fontColor = MPColors.USER_LEAVE; + _hasQuit = true; } } }