1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 21:19:10 +00:00

(svn r2405) Simplify a few '? true : false' and '? false : true', especially the latter is confusing

This commit is contained in:
tron
2005-06-04 07:35:12 +00:00
parent 7f0caaa89a
commit 43f7974f6d
5 changed files with 8 additions and 8 deletions

View File

@@ -488,7 +488,7 @@ static void NetworkStartServerWindowWndProc(Window *w, WindowEvent *e)
switch (e->event) {
case WE_CREATE: /* focus input box */
_selected_field = 3;
_network_game_info.use_password = (_network_server_password[0] == '\0') ? 0 : 1;
_network_game_info.use_password = (_network_server_password[0] != '\0');
break;
case WE_PAINT: {
@@ -591,7 +591,7 @@ static void NetworkStartServerWindowWndProc(Window *w, WindowEvent *e)
case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */
switch(e->dropdown.button) {
case 8:
_network_advertise = (e->dropdown.index == 0) ? false : true;
_network_advertise = (e->dropdown.index != 0);
break;
case 10:
_network_game_info.clients_max = e->dropdown.index + 2;
@@ -617,7 +617,7 @@ static void NetworkStartServerWindowWndProc(Window *w, WindowEvent *e)
case WE_ON_EDIT_TEXT: {
const char *b = e->edittext.str;
ttd_strlcpy(_network_server_password, b, sizeof(_network_server_password));
_network_game_info.use_password = (_network_server_password[0] == '\0') ? 0 : 1;
_network_game_info.use_password = (_network_server_password[0] != '\0');
SetWindowDirty(w);
} break;
}