Mercurial > hg > openttd
changeset 6342:02bfc4a81378 draft
(svn r9367) -Fix (r9315): If a new house doesn't have a corresponding action 3, the
graphics for the substitute (original) house should be drawn instead.
author | maedhros <maedhros@openttd.org> |
---|---|
date | Tue, 20 Mar 2007 10:06:39 +0000 |
parents | 280a7a02939a |
children | f75b72d9fc98 |
files | src/newgrf.cpp src/town_cmd.cpp |
diffstat | 2 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1256,6 +1256,7 @@ housespec[i]->enabled = true; housespec[i]->local_id = hid + i; housespec[i]->substitute_id = subs_id; + housespec[i]->grffile = _cur_grffile; housespec[i]->random_colour[0] = 0x04; // those 4 random colours are the base colour housespec[i]->random_colour[1] = 0x08; // for all new houses housespec[i]->random_colour[2] = 0x0C; // they stand for red, blue, orange and green @@ -2316,7 +2317,6 @@ } hs->spritegroup = _cur_grffile->spritegroups[groupid]; - hs->grffile = _cur_grffile; } return; }
--- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -127,8 +127,15 @@ HouseID house_id = GetHouseType(ti->tile); if (house_id >= NEW_HOUSE_OFFSET) { - DrawNewHouseTile(ti, house_id); - return; + /* Houses don't necessarily need new graphics. If they don't have a + * spritegroup associated with them, then the sprite for the substitute + * house id is drawn instead. */ + if (GetHouseSpecs(house_id)->spritegroup != NULL) { + DrawNewHouseTile(ti, house_id); + return; + } else { + house_id = GetHouseSpecs(house_id)->substitute_id; + } } /* Retrieve pointer to the draw town tile struct */