Changeset - r23828:600da003c21e
[Not reviewed]
master
0 1 0
Niels Martin Hansen - 5 years ago 2019-09-08 08:26:09
nielsm@indvikleren.dk
Fix #7479: Don't close construction windows when changing client name
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/company_cmd.cpp
Show inline comments
 
@@ -104,15 +104,18 @@ void SetLocalCompany(CompanyID new_compa
 
	/* company could also be COMPANY_SPECTATOR or 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;
 

	
 
	/* 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);
 

	
 
	assert(IsLocalCompany());
 

	
 
	_current_company = _local_company = new_company;
 

	
 
	/* Delete any construction windows... */
 
	DeleteConstructionWindows();
 
	if (switching_company) DeleteConstructionWindows();
 

	
 
	/* ... and redraw the whole screen. */
 
	MarkWholeScreenDirty();
0 comments (0 inline, 0 general)