Codechange: introduce GetMainWindow() to properly account for nullptr checks
Some nullptr checks have been removed as they were not triggered with nullptr with the null video driver and in dedicated server mode.
This commit is contained in:
@@ -235,7 +235,7 @@ public:
|
||||
int scr_bot = GetMainViewBottom() - 20;
|
||||
|
||||
Point pt = RemapCoords(this->position.x, this->position.y, GetSlopePixelZOutsideMap(this->position.x, this->position.y));
|
||||
const Viewport *vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
|
||||
const Viewport *vp = GetMainWindow()->viewport;
|
||||
if (this->face == INVALID_COMPANY) {
|
||||
/* move x pos to opposite corner */
|
||||
pt.x = UnScaleByZoom(pt.x - vp->virtual_left, vp->zoom) + vp->left;
|
||||
|
Reference in New Issue
Block a user