浏览代码

修复刷分 Bug

LTCatt 6 年之前
父节点
当前提交
ef84586603
共有 2 个文件被更改,包括 6 次插入 和 1 次删除
  1. 5 0
      data/ltw/functions/main/game_end.mcfunction
  2. 1 1
      data/ltw/functions/main/player_leave.mcfunction

+ 5 - 0
data/ltw/functions/main/game_end.mcfunction

@@ -38,6 +38,11 @@ scoreboard players operation #rank2_gold mem /= #const_100 mem
 scoreboard players set #rank3_gold mem 1
 scoreboard players operation #rank3_gold mem *= #total_gold mem
 scoreboard players operation #rank3_gold mem /= #const_100 mem
+# 如果因为掉线强制结束则无奖励
+execute store result score #count mem if entity @a[tag=!watcher]
+execute if score #count mem matches ..2 run scoreboard players set #rank1_gold mem 0
+execute if score #count mem matches ..2 run scoreboard players set #rank2_gold mem 0
+execute if score #count mem matches ..2 run scoreboard players set #rank3_gold mem 0
 
 # 显示排名
 tellraw @a ["",{"text":"\n\n\n\n----- 游戏结束 -----\n","color":"green","bold":true}]

+ 1 - 1
data/ltw/functions/main/player_leave.mcfunction

@@ -4,7 +4,7 @@ execute as @a at @s run function lib:sounds/error
 # 由于玩家人数不足,强制结束游戏
 execute store result score #count mem if entity @a[tag=!watcher]
 execute if score $state mem matches 1.. if score $game_type mem matches 1 if score #count mem matches ..2 run function ltw:main/game_end
-execute if score $state mem matches 1.. if score $game_type mem matches 1 if score #count mem matches ..2 run tellraw @a {"text": "由于玩家人数不足, 游戏直接结束!","color":"red"}
+execute if score $state mem matches 1.. if score $game_type mem matches 1 if score #count mem matches ..2 run tellraw @a {"text": "由于玩家人数不足, 游戏直接结束且无金粒奖励","color":"red"}
 
 # 如果携带热土豆的玩家掉线,则重新生成土豆
 execute if score $state mem matches 5 if score $mini_type mem matches 3 run function mini:hotpm/player_leave