From 18c202e4691e8bb82d5a0d32f283f89ca0dd242c Mon Sep 17 00:00:00 2001 From: szdytom Date: Mon, 28 Aug 2023 17:00:09 +0800 Subject: [PATCH] fix bugs Signed-off-by: szdytom --- src/ica-admin.sc | 10 +++++++--- src/ica-vote.sc | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ica-admin.sc b/src/ica-admin.sc index 8ef03f9..32634ef 100644 --- a/src/ica-admin.sc +++ b/src/ica-admin.sc @@ -101,18 +101,18 @@ endGameTitle(p, m, s) -> ( ); endTimeout(iv) -> ( - endCleanup(); endGameTitle(getPigPlayers(), 'Timeout!' , str('You didn\'t complete %d goals in time.', iv)); endGameTitle(getWolfPlayers(), 'You won!' , str('Those fools have failed, good job.', iv)); + endCleanup(); ); endFinish() -> ( - endCleanup(); endGameTitle(getPigPlayers(), 'Congratulations!', 'You have completed all the goals.'); endGameTitle(getWolfPlayers(), 'Oh no!' , str('They have completed all the goals.', iv)); + endCleanup(); ); getFirstUnsetGoal() -> ( @@ -142,7 +142,11 @@ warnDeadline(dt) -> ( ); electionKill(pname) -> ( - modify(player(pname), 'kill'); + p = player(pname); + if(p != null, ( + modify(p, 'tag', 'ica.deceased'); + modify(p, 'gamemode', 'spectator'); + )); print(player('all'), str('Election victim %s killed.', pname)) ); diff --git a/src/ica-vote.sc b/src/ica-vote.sc index 1c4100a..f2913d8 100644 --- a/src/ica-vote.sc +++ b/src/ica-vote.sc @@ -30,11 +30,11 @@ cmdInfo() -> ( for(cand_names, ( p = player(_); v_cnt = countVotes(_); - print(str(' - %02d vote%s %s%s', v_cnt, if(v_cnt > 1, 's', ' ') + print(str(' - [%02d vote%s] %s%s', v_cnt, if(v_cnt > 1, 's', ' ') , _, if(query(p, 'has_scoreboard_tag', 'ica.deceased'), ' [deceased]', ''))); )); abv_cnt = countAbstainVotes(); - print(' - %02d vote%s (abstain)', abv_cnt, if(abv_cnt > 1, 's', ' ')); + print(str(' - [%2d vote%s] (abstain)', abv_cnt, if(abv_cnt > 1, 's', ' '))); max_p = findVoteMax(); print(str('Current elected: %s', if(max_p == null, '(nobody)', max_p)));