fix saddle sanity check code
Fix some bad code for "no saddle" caused by careless editing that
changed (uncomitted)
char *ns = 0;
if (foo)
ns = "foo";
else if (bar)
ns = "bar";
by splicing lines together and accidentally ended up with
char *ns;
ns = foo ? ns = "foo" : bar ? ns = "bar" : 0;
when
char *ns;
ns = foo ? "foo" : bar ? "bar" : 0;
was intended.
I'm a bit surprised that the intermediate form without any
parentheses around 'ns = "bar"' compiles at all. C99? I don't
think that it would have if it had been processed as C90 or pre-ANSI.
This commit is contained in:
@@ -111,8 +111,8 @@ sanity_check_single_mon(
|
|||||||
if (mtmp == u.usteed) {
|
if (mtmp == u.usteed) {
|
||||||
const char *ns, *nt = !mtmp->mtame ? "not tame" : 0;
|
const char *ns, *nt = !mtmp->mtame ? "not tame" : 0;
|
||||||
|
|
||||||
ns = !m_carrying(mtmp, SADDLE) ? ns = "no saddle"
|
ns = !m_carrying(mtmp, SADDLE) ? "no saddle"
|
||||||
: !which_armor(mtmp, W_SADDLE) ? ns = "saddle not worn"
|
: !which_armor(mtmp, W_SADDLE) ? "saddle not worn"
|
||||||
: 0;
|
: 0;
|
||||||
if (ns || nt)
|
if (ns || nt)
|
||||||
impossible("steed: %s%s%s (%s)",
|
impossible("steed: %s%s%s (%s)",
|
||||||
|
|||||||
Reference in New Issue
Block a user