summaryrefslogtreecommitdiff
path: root/server/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/game.cpp')
-rw-r--r--server/game.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/server/game.cpp b/server/game.cpp
index 5827565..501aa57 100644
--- a/server/game.cpp
+++ b/server/game.cpp
@@ -327,6 +327,10 @@ void Game::handle_action_discard(Action action, int player) {
void Game::round_end(Endcondition end) {
Message::RoundEnd::p msg = make_shared<Message::RoundEnd>();
+ for(int i = 0; i < 4; i++) {
+ msg->score[current_player + i].won = 0;
+ msg->score[current_player + i].score = players[current_player + i].get_state().score;
+ }
switch(end) {
case Draw:
@@ -345,8 +349,21 @@ void Game::round_end(Endcondition end) {
if(current_player == round_num) {
msg->won = 3 * player.won_value.tsumo_east();
+ msg->score[current_player].won = msg->won;
+ for(int i = 1; i < 4; i++) {
+ msg->score[current_player + i]. won = -(msg->won / 3);
+ }
} else {
msg->won = player.won_value.tsumo_east() + 2 * player.won_value.tsumo();
+ for(int i = 0; i < 4; i++) {
+ if(i == current_player) {
+ msg->score[i].won = msg->won;
+ } else if (i == round_num){
+ msg->score[i].won = -(player.won_value.tsumo_east());
+ } else {
+ msg->score[i].won = -(player.won_value.tsumo());
+ }
+ }
}
} break;
@@ -375,6 +392,9 @@ void Game::round_end(Endcondition end) {
break;
}
+ //Send med score
+
+
round_num++;
if(!round_num) {