summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--industry_cmd.c6
-rw-r--r--industry_map.h11
2 files changed, 13 insertions, 4 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index 829c91a9d..a6974f87d 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -1474,10 +1474,8 @@ static void DoCreateNewIndustry(Industry* i, TileIndex tile, int type, const Ind
DoCommandByTile(cur_tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
- SetTileType(cur_tile, MP_INDUSTRY);
- _m[cur_tile].m5 = it->map5;
- _m[cur_tile].m2 = i->index;
- _m[cur_tile].m1 = _generating_world ? 0x1E : 0; /* maturity */
+ MakeIndustry(cur_tile, i->index, it->map5);
+ if (_generating_world) _m[cur_tile].m1 = 0x1E; /* maturity */
}
} while ((++it)->ti.x != -0x80);
diff --git a/industry_map.h b/industry_map.h
index c3a8d0b1c..63c289503 100644
--- a/industry_map.h
+++ b/industry_map.h
@@ -14,3 +14,14 @@ static inline Industry* GetIndustryByTile(TileIndex t)
{
return GetIndustry(GetIndustryIndex(t));
}
+
+
+static inline void MakeIndustry(TileIndex t, uint index, uint gfx)
+{
+ SetTileType(t, MP_INDUSTRY);
+ _m[t].m1 = 0;
+ _m[t].m2 = index;
+ _m[t].m3 = 0;
+ _m[t].m4 = 0;
+ _m[t].m5 = gfx;
+}