Merge branch 'master' into develop

Conflicts:
	src/buildno.h
This commit is contained in:
Enno Rehling 2016-08-07 00:47:50 +02:00
commit 4f5bd43dcf
3 changed files with 16 additions and 11 deletions

View File

@ -387,7 +387,7 @@ void destroyfaction(faction ** fp)
else {
region *r = u->region;
if (!fval(r->terrain, SEA_REGION) && !!playerrace(u_race(u))) {
if (r->land && !!playerrace(u_race(u))) {
const race *rc = u_race(u);
int m = rmoney(r);

View File

@ -334,7 +334,7 @@ int gift_items(unit * u, int flags)
item *itm = *itm_p;
if (flags & GIFT_PEASANTS) {
if (!fval(u->region->terrain, SEA_REGION)) {
if (u->region->land) {
if (itm->type->rtype == rsilver) {
rsetmoney(r, rmoney(r) + itm->number);
itm->number = 0;

View File

@ -1222,23 +1222,28 @@ static void nmr_death(faction * f)
static void remove_idle_players(void)
{
faction **fp;
int timeout = NMRTimeout();
log_info(" - beseitige Spieler, die sich zu lange nicht mehr gemeldet haben...");
for (fp = &factions; *fp;) {
faction *f = *fp;
if (fval(f, FFL_NOIDLEOUT)) {
f->lastorders = turn;
}
if (NMRTimeout() > 0 && turn - f->lastorders >= NMRTimeout()) {
if (timeout > 0 && turn - f->lastorders >= timeout) {
nmr_death(f);
destroyfaction(fp);
} else if (turn != f->lastorders) {
char info[256];
sprintf(info, "%d Einheiten, %d Personen, %d Silber",
f->no_units, f->num_total, f->money);
} else {
if (fval(f, FFL_NOIDLEOUT)) {
f->lastorders = turn;
fp = &f->next;
}
else if (turn != f->lastorders) {
char info[256];
sprintf(info, "%d Einheiten, %d Personen, %d Silber",
f->no_units, f->num_total, f->money);
}
fp = &f->next;
}
fp = &f->next;
}
log_info(" - beseitige Spieler, die sich nach der Anmeldung nicht gemeldet haben...");