Selaa lähdekoodia

修复中途加入的旁观者未重置得分的 Bug

LTCatt 6 vuotta sitten
vanhempi
sitoutus
8443429cd6

+ 4 - 0
data/ltw/functions/main/player_enter_watcher.mcfunction

@@ -7,6 +7,10 @@ tag @s remove mini_rank2
 tag @s remove mini_rank3
 tag @s remove mini_rank4
 
+# 清除得分显示(防止中途加入的旁观者依然保留上一局的得分)
+scoreboard players reset @s total_score
+scoreboard players reset @s total_score_disp
+
 # 重新加入阶段
 tag @s add rejoining
 execute if score $state mem matches 0 run function ltw:state/0/player_enter

+ 2 - 0
data/ltw/functions/state/0/start_gameparty.mcfunction

@@ -7,6 +7,8 @@ tag @a[tag=!hub_gameparty] add watcher
 # 设置数据
 scoreboard players reset * total_score
 scoreboard players set @a[tag=!watcher] total_score 0
+scoreboard players reset * total_score_disp
+scoreboard players set @a[tag=!watcher] total_score_disp 0
 scoreboard players set $round mem 1
 scoreboard players set $game_type mem 1
 scoreboard players add $ game_id 1

+ 1 - 1
data/ltw/functions/state/3/state_enter.mcfunction

@@ -4,7 +4,7 @@ execute as @a run function ltw:state/3/player_enter
 
 # HUD
 scoreboard objectives setdisplay belowName total_score_disp
-scoreboard objectives setdisplay sidebar total_score_disp
+scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 
 # 初始化倒计时

+ 1 - 1
data/ltw/functions/state/4/state_enter.mcfunction

@@ -4,7 +4,7 @@ execute as @a run function ltw:state/4/player_enter
 
 # HUD
 scoreboard objectives setdisplay belowName total_score_disp
-scoreboard objectives setdisplay sidebar total_score_disp
+scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 
 # 初始化倒计时

+ 1 - 1
data/ltw/functions/state/6/state_enter.mcfunction

@@ -4,7 +4,7 @@ execute as @a run function ltw:state/6/player_enter
 
 # HUD
 scoreboard objectives setdisplay belowName total_score_disp
-scoreboard objectives setdisplay sidebar total_score_disp
+scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 
 # 初始化倒计时

+ 1 - 1
data/ltw/functions/state/7/state_enter.mcfunction

@@ -4,7 +4,7 @@ execute as @a run function ltw:state/7/player_enter
 
 # HUD
 scoreboard objectives setdisplay belowName total_score_disp
-scoreboard objectives setdisplay sidebar total_score_disp
+scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 
 # 初始化跑酷地图

+ 2 - 2
data/mini/functions/main/game_start.mcfunction

@@ -1,8 +1,8 @@
 
 # HUD
-execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay sidebar total_score_disp
+execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay sidebar total_score
 execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay belowName total_score_disp
-execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay sidebar total_score_disp
+execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay sidebar total_score
 execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay belowName total_score_disp
 execute if score $mini_type mem matches 3 run scoreboard objectives setdisplay sidebar mini_heart
 execute if score $mini_type mem matches 3 run scoreboard objectives setdisplay belowName mini_heart