do not hard-code list of allowed races for demons.

This commit is contained in:
Enno Rehling 2017-04-17 20:18:37 +02:00
parent 635ec6d6c6
commit 9fcab4ccb8
1 changed files with 1 additions and 9 deletions

View File

@ -247,15 +247,7 @@ int setstealth_cmd(unit * u, struct order *ord)
if (trace) { if (trace) {
/* demons can cloak as other player-races */ /* demons can cloak as other player-races */
if (u_race(u) == get_race(RC_DAEMON)) { if (u_race(u) == get_race(RC_DAEMON)) {
race_t allowed[] = { RC_DWARF, RC_ELF, RC_ORC, RC_GOBLIN, RC_HUMAN, if (playerrace(trace)) {
RC_TROLL, RC_DAEMON, RC_INSECT, RC_HALFLING, RC_CAT, RC_AQUARIAN,
NORACE
};
int i;
for (i = 0; allowed[i] != NORACE; ++i)
if (get_race(allowed[i]) == trace)
break;
if (allowed[i]!=NORACE && get_race(allowed[i]) == trace) {
u->irace = trace; u->irace = trace;
if (u_race(u)->flags & RCF_SHAPESHIFTANY && get_racename(u->attribs)) if (u_race(u)->flags & RCF_SHAPESHIFTANY && get_racename(u->attribs))
set_racename(&u->attribs, NULL); set_racename(&u->attribs, NULL);