forked from github/server
Merge pull request #867 from ennorehling/master
rule_give is crufty, do not involve it in destroyfaction
This commit is contained in:
commit
f8e2657b62
|
@ -534,6 +534,7 @@ int rule_give(void)
|
||||||
static int config;
|
static int config;
|
||||||
static int rule;
|
static int rule;
|
||||||
if (config_changed(&config)) {
|
if (config_changed(&config)) {
|
||||||
|
/* TODO: No game uses this. Eliminate? */
|
||||||
rule = config_get_int("rules.give.flags", GIVE_DEFAULT);
|
rule = config_get_int("rules.give.flags", GIVE_DEFAULT);
|
||||||
}
|
}
|
||||||
return rule;
|
return rule;
|
||||||
|
|
|
@ -239,19 +239,9 @@ int gift_items(unit * u, int flags)
|
||||||
region *r = u->region;
|
region *r = u->region;
|
||||||
item **itm_p = &u->items;
|
item **itm_p = &u->items;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
int rule = rule_give();
|
|
||||||
|
|
||||||
assert(u->region);
|
assert(u->region);
|
||||||
|
|
||||||
if ((rule & GIVE_ONDEATH) == 0 || !u->faction || (u->faction->flags & FFL_QUIT) == 0) {
|
|
||||||
if ((rule & GIVE_ALLITEMS) == 0 && (flags & GIFT_FRIENDS))
|
|
||||||
flags -= GIFT_FRIENDS;
|
|
||||||
if ((rule & GIVE_PEASANTS) == 0 && (flags & GIFT_PEASANTS))
|
|
||||||
flags -= GIFT_PEASANTS;
|
|
||||||
if ((rule & GIVE_SELF) == 0 && (flags & GIFT_SELF))
|
|
||||||
flags -= GIFT_SELF;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (u->items == NULL || fval(u_race(u), RCF_ILLUSIONARY))
|
if (u->items == NULL || fval(u_race(u), RCF_ILLUSIONARY))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue