mirror of https://github.com/OpenTTD/OpenTTD
(svn r19854) [1.0] -Backport from trunk:
- Fix: Avoid showing building toolbars behind the main toolbar when the 'Link landscape toolbar' setting is active [FS#3781] (r19696) - Fix: Under some circumstances the player's name could be empty (r19693) - Fix: Do not show an error message when trying to give another client an amount of 0 money [FS#3779] (r19684) - Fix: Do not display an error message when double clicking on a vehicle in the 'available vehicles'-window (r19669)release/1.0
parent
233ff7cacd
commit
530d904f84
|
@ -1017,7 +1017,7 @@ struct BuildVehicleWindow : Window {
|
||||||
size_t num_items = this->eng_list.Length();
|
size_t num_items = this->eng_list.Length();
|
||||||
this->sel_engine = (i < num_items) ? this->eng_list[i] : INVALID_ENGINE;
|
this->sel_engine = (i < num_items) ? this->eng_list[i] : INVALID_ENGINE;
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
if (click_count > 1) this->OnClick(pt, BUILD_VEHICLE_WIDGET_BUILD, 1);
|
if (click_count > 1 && !this->listview_mode) this->OnClick(pt, BUILD_VEHICLE_WIDGET_BUILD, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ CommandCost CmdGiveMoney(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||||
CommandCost amount(EXPENSES_OTHER, min((Money)p1, (Money)20000000LL));
|
CommandCost amount(EXPENSES_OTHER, min((Money)p1, (Money)20000000LL));
|
||||||
|
|
||||||
/* You can only transfer funds that is in excess of your loan */
|
/* You can only transfer funds that is in excess of your loan */
|
||||||
if (c->money - c->current_loan < amount.GetCost() || amount.GetCost() <= 0) return CMD_ERROR;
|
if (c->money - c->current_loan < amount.GetCost() || amount.GetCost() < 0) return CMD_ERROR;
|
||||||
if (!_networking || !Company::IsValidID((CompanyID)p2)) return CMD_ERROR;
|
if (!_networking || !Company::IsValidID((CompanyID)p2)) return CMD_ERROR;
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
|
|
|
@ -77,6 +77,7 @@ struct CommandPacket;
|
||||||
/** Status of a client */
|
/** Status of a client */
|
||||||
enum ClientStatus {
|
enum ClientStatus {
|
||||||
STATUS_INACTIVE, ///< The client is not connected nor active
|
STATUS_INACTIVE, ///< The client is not connected nor active
|
||||||
|
STATUS_NEWGRFS_CHECK, ///< The client is checking NewGRFs
|
||||||
STATUS_AUTH_GAME, ///< The client is authorizing with game (server) password
|
STATUS_AUTH_GAME, ///< The client is authorizing with game (server) password
|
||||||
STATUS_AUTH_COMPANY, ///< The client is authorizing with company password
|
STATUS_AUTH_COMPANY, ///< The client is authorizing with company password
|
||||||
STATUS_AUTHORIZED, ///< The client is authorized
|
STATUS_AUTHORIZED, ///< The client is authorized
|
||||||
|
|
|
@ -660,7 +660,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMPANY_INFO)
|
||||||
|
|
||||||
DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_NEWGRFS_CHECKED)
|
DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_NEWGRFS_CHECKED)
|
||||||
{
|
{
|
||||||
if (cs->status != STATUS_INACTIVE) {
|
if (cs->status != STATUS_NEWGRFS_CHECK) {
|
||||||
/* Illegal call, return error and ignore the packet */
|
/* Illegal call, return error and ignore the packet */
|
||||||
return SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_EXPECTED);
|
return SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_EXPECTED);
|
||||||
}
|
}
|
||||||
|
@ -743,7 +743,10 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
|
||||||
/* Make sure companies to which people try to join are not autocleaned */
|
/* Make sure companies to which people try to join are not autocleaned */
|
||||||
if (Company::IsValidID(playas)) _network_company_states[playas].months_empty = 0;
|
if (Company::IsValidID(playas)) _network_company_states[playas].months_empty = 0;
|
||||||
|
|
||||||
|
cs->status = STATUS_NEWGRFS_CHECK;
|
||||||
|
|
||||||
if (_grfconfig == NULL) {
|
if (_grfconfig == NULL) {
|
||||||
|
/* Behave as if we received PACKET_CLIENT_NEWGRFS_CHECKED */
|
||||||
return RECEIVE_COMMAND(PACKET_CLIENT_NEWGRFS_CHECKED)(cs, NULL);
|
return RECEIVE_COMMAND(PACKET_CLIENT_NEWGRFS_CHECKED)(cs, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1707,6 +1710,7 @@ void NetworkServerShowStatusToConsole()
|
||||||
{
|
{
|
||||||
static const char * const stat_str[] = {
|
static const char * const stat_str[] = {
|
||||||
"inactive",
|
"inactive",
|
||||||
|
"checking NewGRFs",
|
||||||
"authorizing (server password)",
|
"authorizing (server password)",
|
||||||
"authorizing (company password)",
|
"authorizing (company password)",
|
||||||
"authorized",
|
"authorized",
|
||||||
|
|
|
@ -333,19 +333,19 @@ Window *ShowTerraformToolbar(Window *link)
|
||||||
{
|
{
|
||||||
if (!Company::IsValidID(_local_company)) return NULL;
|
if (!Company::IsValidID(_local_company)) return NULL;
|
||||||
|
|
||||||
Window *w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
|
Window *w;
|
||||||
if (link == NULL) return w;
|
if (link == NULL) {
|
||||||
|
w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
|
||||||
if (w == NULL) {
|
return w;
|
||||||
w = FindWindowById(WC_SCEN_LAND_GEN, 0);
|
|
||||||
if (w == NULL) return NULL;
|
|
||||||
} else {
|
|
||||||
w->top -= w->height;
|
|
||||||
w->SetDirty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Align the terraform toolbar under the main toolbar and put the linked
|
/* Delete the terraform toolbar to place it again. */
|
||||||
* toolbar to left/right of it */
|
DeleteWindowById(WC_SCEN_LAND_GEN, 0, true);
|
||||||
|
w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
|
||||||
|
/* Align the terraform toolbar under the main toolbar. */
|
||||||
|
w->top -= w->height;
|
||||||
|
w->SetDirty();
|
||||||
|
/* Put the linked toolbar to the left / right of it. */
|
||||||
link->left = w->left + (_dynlang.text_dir == TD_RTL ? w->width : -link->width);
|
link->left = w->left + (_dynlang.text_dir == TD_RTL ? w->width : -link->width);
|
||||||
link->top = w->top;
|
link->top = w->top;
|
||||||
link->SetDirty();
|
link->SetDirty();
|
||||||
|
|
Loading…
Reference in New Issue