diff options
author | rubidium <rubidium@openttd.org> | 2014-10-21 19:16:47 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-10-21 19:16:47 +0000 |
commit | e811fa1718af11e683b4d2f20e6f62a2cd004821 (patch) | |
tree | 3d607f1a810193ef509d90fd01751ddad086072f /src/widget.cpp | |
parent | 96c321e9588dd0548f01e19e91fbe545e003480e (diff) | |
download | openttd-e811fa1718af11e683b4d2f20e6f62a2cd004821.tar.xz |
(svn r27030) -Fix: crash when having the vehicle list opened from a buoy or oil rig while the buoy/oil rig gets its final removal (i.e. the sign gets removed)
Diffstat (limited to 'src/widget.cpp')
-rw-r--r-- | src/widget.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/widget.cpp b/src/widget.cpp index 0532142ae..471840a41 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -538,10 +538,12 @@ static inline void DrawCloseBox(const Rect &r, Colours colour) */ void DrawCaption(const Rect &r, Colours colour, Owner owner, StringID str) { + bool company_owned = owner < MAX_COMPANIES; + DrawFrameRect(r.left, r.top, r.right, r.bottom, colour, FR_BORDERONLY); - DrawFrameRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, colour, (owner == INVALID_OWNER) ? FR_LOWERED | FR_DARKENED : FR_LOWERED | FR_DARKENED | FR_BORDERONLY); + DrawFrameRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, colour, company_owned ? FR_LOWERED | FR_DARKENED | FR_BORDERONLY : FR_LOWERED | FR_DARKENED); - if (owner != INVALID_OWNER) { + if (company_owned) { GfxFillRect(r.left + 2, r.top + 2, r.right - 2, r.bottom - 2, _colour_gradient[_company_colours[owner]][4]); } |