(svn r18717) -Codechange: use TileArea in industry instead of three separate variables. Also make use of TileArea functions for determining the 'width' and 'height' of an industry.

This commit is contained in:
rubidium
2010-01-04 18:21:07 +00:00
parent 0213d47594
commit 6cac8be361
14 changed files with 71 additions and 81 deletions

View File

@@ -83,7 +83,7 @@ struct SubsidyListWindow : Window {
/* determine src coordinate for subsidy and try to scroll to it */
TileIndex xy;
switch (s->src_type) {
case ST_INDUSTRY: xy = Industry::Get(s->src)->xy; break;
case ST_INDUSTRY: xy = Industry::Get(s->src)->location.tile; break;
case ST_TOWN: xy = Town::Get(s->src)->xy; break;
default: NOT_REACHED();
}
@@ -93,7 +93,7 @@ struct SubsidyListWindow : Window {
/* otherwise determine dst coordinate for subsidy and scroll to it */
switch (s->dst_type) {
case ST_INDUSTRY: xy = Industry::Get(s->dst)->xy; break;
case ST_INDUSTRY: xy = Industry::Get(s->dst)->location.tile; break;
case ST_TOWN: xy = Town::Get(s->dst)->xy; break;
default: NOT_REACHED();
}