aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/gamedb.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-05-04 16:03:37 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-05-04 16:03:37 +0200
commit8973992cf3dcf3c32ec313eafd399ef96dc75c2d (patch)
tree312a74ebdece1bf8e3369225b77631b9af31672e /FICS/gamedb.c
parent7ed4d3b97897d16e88284209e50de66f8eb74f3d (diff)
Reformatted send_board_to()
Diffstat (limited to 'FICS/gamedb.c')
-rw-r--r--FICS/gamedb.c126
1 files changed, 65 insertions, 61 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c
index 8554df3..609a4fe 100644
--- a/FICS/gamedb.c
+++ b/FICS/gamedb.c
@@ -222,76 +222,80 @@ PUBLIC int game_isblitz(int wt, int winc, int bt, int binc,
return TYPE_BLITZ;
}
-PUBLIC void send_board_to(int g, int p)
+PUBLIC void
+send_board_to(int g, int p)
{
- char *b;
- int side;
- int relation;
-
-/* since we know g and p, figure out our relationship to this game */
-
- side = WHITE;
- if (garray[g].status == GAME_EXAMINE) {
- if (parray[p].game == g) {
- relation = 2;
- } else {
- relation = -2;
- }
- } else {
- if (parray[p].game == g) {
- side = parray[p].side;
- relation = ((side == garray[g].game_state.onMove) ? 1 : -1);
- } else {
- relation = 0;
- }
- }
+ char *b;
+ int relation;
+ int side;
- if (parray[p].flip) { /* flip board? */
- if (side == WHITE)
- side = BLACK;
- else
- side = WHITE;
- }
- game_update_time(g);
- b = board_to_string(garray[g].white_name,
- garray[g].black_name,
- garray[g].wTime,
- garray[g].bTime,
- &garray[g].game_state,
- (garray[g].status == GAME_EXAMINE) ?
- garray[g].examMoveList : garray[g].moveList,
- parray[p].style,
- side, relation, p);
+ /*
+ * Since we know 'g' and 'p', figure out our relationship to
+ * this game...
+ */
-#ifdef TIMESEAL
+ side = WHITE;
- if (con[parray[p].socket].timeseal) {
- if (parray[p].bell) {
- pprintf_noformat(p, "\007\n[G]\n%s", b);
- } else {
- pprintf_noformat(p, "\n[G]\n%s", b);
- }
- } else {
- if (parray[p].bell) {
- pprintf_noformat(p, "\007\n%s", b);
- } else {
- pprintf_noformat(p, "\n%s", b);
- }
- }
+ if (garray[g].status == GAME_EXAMINE) {
+ if (parray[p].game == g) {
+ relation = 2;
+ } else {
+ relation = -2;
+ }
+ } else {
+ if (parray[p].game == g) {
+ side = parray[p].side;
+ relation = (side == garray[g].game_state.onMove ? 1 :
+ -1);
+ } else {
+ relation = 0;
+ }
+ }
-#else
+ if (parray[p].flip) { // flip board?
+ if (side == WHITE)
+ side = BLACK;
+ else
+ side = WHITE;
+ }
- if (parray[p].bell) {
- pprintf_noformat(p, "\007\n%s", b);
- } else {
- pprintf_noformat(p, "\n%s", b);
- }
+ game_update_time(g);
+ b = board_to_string(garray[g].white_name, garray[g].black_name,
+ garray[g].wTime,
+ garray[g].bTime,
+ &garray[g].game_state,
+ (garray[g].status == GAME_EXAMINE)
+ ? garray[g].examMoveList
+ : garray[g].moveList,
+ parray[p].style,
+ side,
+ relation,
+ p);
+#ifdef TIMESEAL
+ if (con[parray[p].socket].timeseal) {
+ if (parray[p].bell) {
+ pprintf_noformat(p, "\007\n[G]\n%s", b);
+ } else {
+ pprintf_noformat(p, "\n[G]\n%s", b);
+ }
+ } else {
+ if (parray[p].bell) {
+ pprintf_noformat(p, "\007\n%s", b);
+ } else {
+ pprintf_noformat(p, "\n%s", b);
+ }
+ }
+#else
+ if (parray[p].bell) {
+ pprintf_noformat(p, "\007\n%s", b);
+ } else {
+ pprintf_noformat(p, "\n%s", b);
+ }
#endif
- if (p != commanding_player) {
- pprintf(p, "%s", parray[p].prompt);
- }
+ if (p != commanding_player)
+ pprintf(p, "%s", parray[p].prompt);
}
PUBLIC void