Skip to content

Commit 00859f0

Browse files
committed
Merge branch 'master' of https://github.com/zenorogue/hyperrogue
2 parents ce95c90 + 8bb576e commit 00859f0

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

graph.cpp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,14 @@ EX transmatrix at_smart_lof(const transmatrix& V, ld lev) {
143143
EX shiftmatrix at_smart_lof(const shiftmatrix& V, ld lev) { return shiftless(at_smart_lof(V.T, lev), V.shift); }
144144

145145
EX color_t kind_outline(eItem it) {
146-
int k = itemclass(it);
147-
if(k == IC_TREASURE)
148-
return OUTLINE_TREASURE;
149-
else if(k == IC_ORB)
150-
return OUTLINE_ORB;
151-
else
152-
return OUTLINE_OTHER;
146+
switch(itemclass(it)) {
147+
case IC_TREASURE:
148+
return OUTLINE_TREASURE;
149+
case IC_ORB:
150+
return OUTLINE_ORB;
151+
default:
152+
return OUTLINE_OTHER;
153+
}
153154
}
154155

155156
/** should objects fly slightly up and down in product/twisted product geometries */
@@ -195,15 +196,8 @@ EX int cellcolor(cell *c) {
195196

196197
if(c->wall == waMirror) return c->land == laMirror ? OUTLINE_TREASURE : OUTLINE_ORB;
197198

198-
if(c->item && !itemHiddenFromSight(c)) {
199-
int k = itemclass(c->item);
200-
if(k == IC_TREASURE)
201-
return OUTLINE_TREASURE;
202-
else if(k == IC_ORB)
203-
return OUTLINE_ORB;
204-
else
205-
return OUTLINE_OTHER;
206-
}
199+
if(c->item && !itemHiddenFromSight(c))
200+
return kind_outline(c->item);
207201

208202
return OUTLINE_NONE;
209203
}

0 commit comments

Comments
 (0)