This commit is contained in:
Enno Rehling 2014-08-17 07:37:50 +02:00
commit 99124f3d6d
1 changed files with 2 additions and 10 deletions

View File

@ -105,14 +105,12 @@ void set_show_item(faction * f, const struct item_type *itype)
a->data.v = (void *)itype;
}
static faction *monsters;
faction *get_monsters(void) {
faction *f;
for (f = factions; f; f = f->next) {
if ((f->flags & FFL_NPC) && !(f->flags & FFL_DEFENDER)) {
return monsters = f;
return f;
}
}
return 0;
@ -121,12 +119,6 @@ faction *get_monsters(void) {
faction *get_or_create_monsters(void)
{
faction *f = get_monsters();
static int gamecookie = -1;
if (gamecookie != global.cookie) {
monsters = NULL;
gamecookie = global.cookie;
}
if (!f) {
/* shit! */
f = findfaction(666);
@ -142,7 +134,7 @@ faction *get_or_create_monsters(void)
if (f) {
fset(f, FFL_NPC | FFL_NOIDLEOUT);
}
return monsters = f;
return f;
}
const unit *random_unit_in_faction(const faction * f)