forked from github/server
santa beschenkt keine ringträger
This commit is contained in:
parent
dcc400d218
commit
41819ed5d6
|
@ -19,6 +19,7 @@
|
||||||
#include <region.h>
|
#include <region.h>
|
||||||
#include <movement.h>
|
#include <movement.h>
|
||||||
#include <faction.h>
|
#include <faction.h>
|
||||||
|
#include <item.h>
|
||||||
#include <race.h>
|
#include <race.h>
|
||||||
|
|
||||||
/* util includes */
|
/* util includes */
|
||||||
|
@ -28,6 +29,8 @@ void
|
||||||
santa_comes_to_town(region * r, unit * santa, void (*action)(unit*))
|
santa_comes_to_town(region * r, unit * santa, void (*action)(unit*))
|
||||||
{
|
{
|
||||||
faction * f;
|
faction * f;
|
||||||
|
const item_type * roi = it_find("roi");
|
||||||
|
assert(roi);
|
||||||
|
|
||||||
fset(santa, FL_TRAVELTHRU);
|
fset(santa, FL_TRAVELTHRU);
|
||||||
for (f = factions;f;f=f->next) {
|
for (f = factions;f;f=f->next) {
|
||||||
|
@ -35,7 +38,7 @@ santa_comes_to_town(region * r, unit * santa, void (*action)(unit*))
|
||||||
unit * senior = f->units;
|
unit * senior = f->units;
|
||||||
if (!playerrace(f->race)) continue;
|
if (!playerrace(f->race)) continue;
|
||||||
for (u = f->units; u; u=u->nextF) {
|
for (u = f->units; u; u=u->nextF) {
|
||||||
if (senior->age < u->age || effstealth(senior) > effstealth(u)) senior = u;
|
if (senior->age < u->age || effstealth(senior) > effstealth(u) || i_get(senior->items, roi)) senior = u;
|
||||||
}
|
}
|
||||||
if (!senior) continue;
|
if (!senior) continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue