From ad146602c75643366043fe51599a219b2dff0e4f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 21 May 2012 17:56:27 -0700 Subject: [PATCH] change the order in which TARNE arguments are checked, to handle simple cases first. --- src/gamecode/spy.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/gamecode/spy.c b/src/gamecode/spy.c index 2b9c948a6..10b83f31a 100644 --- a/src/gamecode/spy.c +++ b/src/gamecode/spy.c @@ -224,6 +224,17 @@ int setstealth_cmd(unit * u, struct order *ord) return 0; } + if (isdigit(s[0])) { + /* Tarnungslevel setzen */ + level = atoi((const char *)s); + if (level > effskill(u, SK_STEALTH)) { + ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_lowstealth", "")); + return 0; + } + u_seteffstealth(u, level); + return 0; + } + trace = findrace(s, u->faction->locale); if (trace) { /* Dämonen können sich nur als andere Spielerrassen tarnen */ @@ -316,17 +327,10 @@ int setstealth_cmd(unit * u, struct order *ord) u_seteffstealth(u, -1); break; default: - if (isdigit(s[0])) { - /* Tarnungslevel setzen */ - level = atoi((const char *)s); - if (level > effskill(u, SK_STEALTH)) { - ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_lowstealth", - "")); - return 0; - } - u_seteffstealth(u, level); - } else if (u->race->flags & RCF_SHAPESHIFTANY) { + if (u->race->flags & RCF_SHAPESHIFTANY) { set_racename(&u->attribs, s); + } else { + cmistake(u, ord, 289, MSG_EVENT); } } return 0;