forked from github/server
Merge pull request #534 from ennorehling/hotfix-bug-2222-nmrdeath
bug 2222: death by NMR was broken
This commit is contained in:
commit
bea8b05ee9
|
@ -1,3 +1,3 @@
|
||||||
#define VERSION_MAJOR 3
|
#define VERSION_MAJOR 3
|
||||||
#define VERSION_MINOR 8
|
#define VERSION_MINOR 8
|
||||||
#define VERSION_BUILD 15
|
#define VERSION_BUILD 16
|
||||||
|
|
|
@ -387,7 +387,7 @@ void destroyfaction(faction ** fp)
|
||||||
else {
|
else {
|
||||||
region *r = u->region;
|
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);
|
const race *rc = u_race(u);
|
||||||
int m = rmoney(r);
|
int m = rmoney(r);
|
||||||
|
|
||||||
|
|
|
@ -334,7 +334,7 @@ int gift_items(unit * u, int flags)
|
||||||
item *itm = *itm_p;
|
item *itm = *itm_p;
|
||||||
|
|
||||||
if (flags & GIFT_PEASANTS) {
|
if (flags & GIFT_PEASANTS) {
|
||||||
if (!fval(u->region->terrain, SEA_REGION)) {
|
if (u->region->land) {
|
||||||
if (itm->type->rtype == rsilver) {
|
if (itm->type->rtype == rsilver) {
|
||||||
rsetmoney(r, rmoney(r) + itm->number);
|
rsetmoney(r, rmoney(r) + itm->number);
|
||||||
itm->number = 0;
|
itm->number = 0;
|
||||||
|
|
15
src/laws.c
15
src/laws.c
|
@ -1221,24 +1221,29 @@ static void nmr_death(faction * f)
|
||||||
static void remove_idle_players(void)
|
static void remove_idle_players(void)
|
||||||
{
|
{
|
||||||
faction **fp;
|
faction **fp;
|
||||||
|
int timeout = NMRTimeout();
|
||||||
|
|
||||||
log_info(" - beseitige Spieler, die sich zu lange nicht mehr gemeldet haben...");
|
log_info(" - beseitige Spieler, die sich zu lange nicht mehr gemeldet haben...");
|
||||||
|
|
||||||
for (fp = &factions; *fp;) {
|
for (fp = &factions; *fp;) {
|
||||||
faction *f = *fp;
|
faction *f = *fp;
|
||||||
if (fval(f, FFL_NOIDLEOUT)) {
|
|
||||||
f->lastorders = turn;
|
if (timeout > 0 && turn - f->lastorders >= timeout) {
|
||||||
}
|
|
||||||
if (NMRTimeout() > 0 && turn - f->lastorders >= NMRTimeout()) {
|
|
||||||
nmr_death(f);
|
nmr_death(f);
|
||||||
destroyfaction(fp);
|
destroyfaction(fp);
|
||||||
} else if (turn != f->lastorders) {
|
} else {
|
||||||
|
if (fval(f, FFL_NOIDLEOUT)) {
|
||||||
|
f->lastorders = turn;
|
||||||
|
fp = &f->next;
|
||||||
|
}
|
||||||
|
else if (turn != f->lastorders) {
|
||||||
char info[256];
|
char info[256];
|
||||||
sprintf(info, "%d Einheiten, %d Personen, %d Silber",
|
sprintf(info, "%d Einheiten, %d Personen, %d Silber",
|
||||||
f->no_units, f->num_total, f->money);
|
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...");
|
log_info(" - beseitige Spieler, die sich nach der Anmeldung nicht gemeldet haben...");
|
||||||
|
|
||||||
age = calloc(_max(4, turn + 1), sizeof(int));
|
age = calloc(_max(4, turn + 1), sizeof(int));
|
||||||
|
|
Loading…
Reference in New Issue