summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-03-06 16:26:09 +0000
committerfrosch <frosch@openttd.org>2010-03-06 16:26:09 +0000
commitef477b7dd78432bd2417d2526c5bc987ff7d3a39 (patch)
tree32f959186133e5372d37c0f4bcce45813c084ef3 /src/misc_gui.cpp
parentbcb01903cdca4232eb2dd5ace0c002fefd2e336b (diff)
downloadopenttd-ef477b7dd78432bd2417d2526c5bc987ff7d3a39.tar.xz
(svn r19358) -Fix [FS#3663]: Close error messages about missing ownership when the company closes or is taken over. (parts by Alberth).
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 42776ca5e..797273af0 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -620,6 +620,12 @@ public:
this->DrawWidgets();
}
+ virtual void OnInvalidateData(int data)
+ {
+ /* If company gets shut down, while displaying an error about it, remove the error message. */
+ if (this->face != INVALID_COMPANY && !Company::IsValidID(this->face)) delete this;
+ }
+
virtual void SetStringParameters(int widget) const
{
if (widget == EMW_CAPTION) CopyInDParam(0, this->decode_params, lengthof(this->decode_params));