mirror of https://github.com/OpenTTD/OpenTTD
Fix #7479: Don't close construction windows when changing client name
parent
e5021a0587
commit
224bb105bc
|
@ -104,9 +104,12 @@ void SetLocalCompany(CompanyID new_company)
|
||||||
/* company could also be COMPANY_SPECTATOR or OWNER_NONE */
|
/* company could also be COMPANY_SPECTATOR or OWNER_NONE */
|
||||||
assert(Company::IsValidID(new_company) || new_company == COMPANY_SPECTATOR || new_company == OWNER_NONE);
|
assert(Company::IsValidID(new_company) || new_company == COMPANY_SPECTATOR || new_company == OWNER_NONE);
|
||||||
|
|
||||||
|
/* If actually changing to another company, several windows need closing */
|
||||||
|
bool switching_company = _local_company != new_company;
|
||||||
|
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
/* Delete the chat window, if you were team chatting. */
|
/* Delete the chat window, if you were team chatting. */
|
||||||
InvalidateWindowData(WC_SEND_NETWORK_MSG, DESTTYPE_TEAM, _local_company);
|
if (switching_company) InvalidateWindowData(WC_SEND_NETWORK_MSG, DESTTYPE_TEAM, _local_company);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
assert(IsLocalCompany());
|
assert(IsLocalCompany());
|
||||||
|
@ -114,7 +117,7 @@ void SetLocalCompany(CompanyID new_company)
|
||||||
_current_company = _local_company = new_company;
|
_current_company = _local_company = new_company;
|
||||||
|
|
||||||
/* Delete any construction windows... */
|
/* Delete any construction windows... */
|
||||||
DeleteConstructionWindows();
|
if (switching_company) DeleteConstructionWindows();
|
||||||
|
|
||||||
/* ... and redraw the whole screen. */
|
/* ... and redraw the whole screen. */
|
||||||
MarkWholeScreenDirty();
|
MarkWholeScreenDirty();
|
||||||
|
|
Loading…
Reference in New Issue