Mercurial > hg > openttd
comparison src/toolbar_gui.cpp @ 12023:3c4566c47b2f draft
(svn r16430) -Fix: crash when a company is deleted while a dropdown with company names is open
author | smatz <smatz@openttd.org> |
---|---|
date | Tue, 26 May 2009 11:57:52 +0000 |
parents | e17a54c88806 |
children | 7f4295a66bff |
comparison
equal
deleted
inserted
replaced
12022:6258c029db2d | 12023:3c4566c47b2f |
---|---|
165 } | 165 } |
166 | 166 |
167 void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const | 167 void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const |
168 { | 168 { |
169 CompanyID company = (CompanyID)result; | 169 CompanyID company = (CompanyID)result; |
170 | |
171 /* It's possible the company is deleted while the dropdown is open */ | |
172 if (!Company::IsValidID(company)) return; | |
173 | |
170 DrawCompanyIcon(company, left + 2, top + 1); | 174 DrawCompanyIcon(company, left + 2, top + 1); |
171 | 175 |
172 SetDParam(0, company); | 176 SetDParam(0, company); |
173 SetDParam(1, company); | 177 SetDParam(1, company); |
174 TextColour col; | 178 TextColour col; |