Commit Diff


commit - 761620d5d2783b1cddf2fd8d66007dedcdb371dc
commit + f97f76d9e526f9cf6b85d77ff64a4c89df864772
blob - 1a2344c533609b9877dd44c51c623b6580752dd9
blob + 38c7849022188bcd2f0a0c9038824f00c4862297
--- FICS/gameproc.c
+++ FICS/gameproc.c
@@ -783,36 +783,41 @@ int CheckRepetition (int p, int g)
   else return 0;
 }
 
-PUBLIC int com_draw(int p, param_list param)
+PUBLIC int
+com_draw(int p, param_list param)
 {
-  int p1, g = parray[p].game;
+	int p1, g = parray[p].game;
 
-  ASSERT(param[0].type == TYPE_NULL);
-  if (!pIsPlaying(p)) {
-    return COM_OK;
-  }
-  if (Check50MoveRule (p, g) || CheckRepetition(p, g)) {
-    return COM_OK;
-  }
-  p1 = parray[p].opponent;
-  if (parray[p1].simul_info.numBoards &&
-      parray[p1].simul_info.boards[parray[p1].simul_info.onBoard] !=
-      g) {
-    pprintf(p, "You can only make requests when the simul player is at your board.\n");
-    return COM_OK;
-  }
-  if (player_find_pendfrom(p, parray[p].opponent, PEND_DRAW) >= 0) {
-    player_remove_request(parray[p].opponent, p, PEND_DRAW);
-    player_decline_offers(p, -1, -1);
-    game_ended(g, (garray[g].white == p) ? BLACK : WHITE, END_AGREEDDRAW);
-  } else {
-    pprintf(parray[p].opponent, "\n");
-    pprintf_highlight(parray[p].opponent, "%s", parray[p].name);
-    pprintf_prompt(parray[p].opponent, " offers you a draw.\n");
-    pprintf(p, "Draw request sent.\n");
-    player_add_request(p, parray[p].opponent, PEND_DRAW, 0);
-  }
-  return COM_OK;
+	ASSERT(param[0].type == TYPE_NULL);
+
+	if (!pIsPlaying(p))
+		return COM_OK;
+	if (Check50MoveRule(p, g) || CheckRepetition(p, g))
+		return COM_OK;
+
+	p1 = parray[p].opponent;
+
+	if (parray[p1].simul_info.numBoards &&
+	    parray[p1].simul_info.boards[parray[p1].simul_info.onBoard] != g) {
+		pprintf(p, "You can only make requests when the simul player "
+		    "is at your board.\n");
+		return COM_OK;
+	}
+
+	if (player_find_pendfrom(p, parray[p].opponent, PEND_DRAW) >= 0) {
+		player_remove_request(parray[p].opponent, p, PEND_DRAW);
+		player_decline_offers(p, -1, -1);
+		game_ended(g, (garray[g].white == p ? BLACK : WHITE),
+		    END_AGREEDDRAW);
+	} else {
+		pprintf(parray[p].opponent, "\n");
+		pprintf_highlight(parray[p].opponent, "%s", parray[p].name);
+		pprintf_prompt(parray[p].opponent, " offers you a draw.\n");
+		pprintf(p, "Draw request sent.\n");
+		player_add_request(p, parray[p].opponent, PEND_DRAW, 0);
+	}
+
+	return COM_OK;
 }
 
 PUBLIC int