From 89cc559a614a086b6927ff5d5d25e77029c5d4fa Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 1 Apr 2024 19:20:23 +0200 Subject: Reformatted RePartner() and made it private --- FICS/variable.c | 55 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/FICS/variable.c b/FICS/variable.c index 7bb181e..7840b40 100644 --- a/FICS/variable.c +++ b/FICS/variable.c @@ -486,28 +486,39 @@ PRIVATE int set_prompt(int p, char *var, char *val) return VAR_OK; } -int RePartner (int p, int new) -{ - int pOld; - - if (p < 0) - return -1; - pOld = parray[p].partner; - if (parray[pOld].partner == p) { - if (new >= 0) - pprintf_prompt (pOld, "Your partner has just chosen a new partner.\n"); - else - pprintf_prompt (pOld, "Your partner has just unset his/her partner.\n"); - player_withdraw_offers (pOld, -1, PEND_BUGHOUSE); - player_decline_offers (pOld, -1, PEND_BUGHOUSE); - player_withdraw_offers (p, -1, PEND_BUGHOUSE); - player_decline_offers (p, -1, PEND_BUGHOUSE); - } - player_withdraw_offers(p, -1, PEND_PARTNER); - player_decline_offers(p, -1, PEND_PARTNER); - parray[pOld].partner = -1; - parray[p].partner = new; - return new; +PRIVATE int +RePartner(int p, int new) +{ + int pOld; + + if (p < 0) + return -1; + + pOld = parray[p].partner; + + if (parray[pOld].partner == p) { + if (new >= 0) { + pprintf_prompt(pOld, "Your partner has just chosen " + "a new partner.\n"); + } else { + pprintf_prompt(pOld, "Your partner has just unset " + "his/her partner.\n"); + } + + player_withdraw_offers(pOld, -1, PEND_BUGHOUSE); + player_decline_offers(pOld, -1, PEND_BUGHOUSE); + + player_withdraw_offers(p, -1, PEND_BUGHOUSE); + player_decline_offers(p, -1, PEND_BUGHOUSE); + } + + player_withdraw_offers(p, -1, PEND_PARTNER); + player_decline_offers(p, -1, PEND_PARTNER); + + parray[pOld].partner = -1; + parray[p].partner = new; + + return new; } PUBLIC int -- cgit v1.2.3