summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilepick.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-10-08 07:18:30 -0500
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-10-08 07:18:30 -0500
commit82fd798480e81c7f00741935cf2d69702daee880 (patch)
tree1a9e8e708b65b51d9f13eb431cbd49bbaab5af51 /crawl-ref/source/tilepick.cc
parenteb35aeaf1c639f7b575f75f15dfff72b02fbee34 (diff)
downloadcrawl-ref-82fd798480e81c7f00741935cf2d69702daee880.tar.gz
crawl-ref-82fd798480e81c7f00741935cf2d69702daee880.zip
Simplify further.
Diffstat (limited to 'crawl-ref/source/tilepick.cc')
-rw-r--r--crawl-ref/source/tilepick.cc44
1 files changed, 15 insertions, 29 deletions
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index ccb6bf102c..591a6459fe 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -101,7 +101,7 @@ static int _bow_offset(const monsters *mon)
{
int mon_wep = mon->inv[MSLOT_WEAPON];
if (mon_wep == NON_ITEM)
- return 1;
+ return (1);
switch (mitm[mon_wep].sub_type)
{
@@ -109,33 +109,9 @@ static int _bow_offset(const monsters *mon)
case WPN_LONGBOW:
case WPN_CROSSBOW:
case WPN_HAND_CROSSBOW:
- return 0;
- default:
- return 1;
- }
-}
-
-static int _ugly_thing_colour_offset(const monsters *mon)
-{
- if (mon->type != MONS_UGLY_THING && mon->type != MONS_VERY_UGLY_THING)
return (0);
-
- switch (make_low_colour(mon->colour))
- {
- case GREEN:
- return (0);
- case CYAN:
- return (1);
- case RED:
- return (2);
- case MAGENTA:
- return (3);
- case BROWN:
- return (4);
- case LIGHTGREY:
- return (5);
- default:
- return (0);
+ default:
+ return (1);
}
}
@@ -376,9 +352,19 @@ int tileidx_monster_base(const monsters *mon, bool detected)
// ugly things ('u')
case MONS_UGLY_THING:
- return TILEP_MONS_UGLY_THING + _ugly_thing_colour_offset(mon);
+ {
+ const int colour_offset = ugly_thing_colour_offset(mon);
+ if (colour_offset == -1)
+ colour_offset = 0;
+ return TILEP_MONS_UGLY_THING + colour_offset;
+ }
case MONS_VERY_UGLY_THING:
- return TILEP_MONS_VERY_UGLY_THING + _ugly_thing_colour_offset(mon);
+ {
+ const int colour_offset = ugly_thing_colour_offset(mon);
+ if (colour_offset == -1)
+ colour_offset = 0;
+ return TILEP_MONS_VERY_UGLY_THING + colour_offset;
+ }
// vortices ('v')
case MONS_FIRE_VORTEX: