forked from github/server
Bug 1664: Obwohl kein Holz vorhanden ist, kommt die Meldung, daß der Unterhalt für die Schmiede gezahlt wurde
Es wird im ersten Durchlauf nur noch gezahlt wenn das Gebäude dann auch Arbeiten kann (also alles da ist). Ich habe den 2ten Durchlauf erhalten, auch wenn er in Code nicht mehr genutzt wird.
This commit is contained in:
parent
46ab9e7bb6
commit
7d64046022
|
@ -1059,9 +1059,9 @@ static bool maintain(building * b, bool first)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (need > 0) {
|
if (need > 0) {
|
||||||
if (!fval(m, MTF_VITAL))
|
work = false;
|
||||||
work = false;
|
if (fval(m, MTF_VITAL))
|
||||||
else {
|
{
|
||||||
paid = false;
|
paid = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1070,16 +1070,21 @@ static bool maintain(building * b, bool first)
|
||||||
}
|
}
|
||||||
if (paid && c > 0) {
|
if (paid && c > 0) {
|
||||||
/* TODO: wieviel von was wurde bezahlt */
|
/* TODO: wieviel von was wurde bezahlt */
|
||||||
if (first) {
|
if (first && work) {
|
||||||
ADDMSG(&u->faction->msgs, msg_message("maintenance", "unit building", u,
|
ADDMSG(&u->faction->msgs, msg_message("maintenance", "unit building", u, b));
|
||||||
b));
|
fset(b, BLD_WORKING);
|
||||||
} else {
|
fset(b, BLD_MAINTAINED);
|
||||||
|
}
|
||||||
|
if (!first) {
|
||||||
ADDMSG(&u->faction->msgs, msg_message("maintenance_late", "building", b));
|
ADDMSG(&u->faction->msgs, msg_message("maintenance_late", "building", b));
|
||||||
|
fset(b, BLD_MAINTAINED);
|
||||||
}
|
}
|
||||||
fset(b, BLD_MAINTAINED);
|
|
||||||
if (work) {
|
if (first && !work) {
|
||||||
fset(b, BLD_WORKING);
|
ADDMSG(&u->faction->msgs, msg_message("maintenancefail", "unit building", u, b));
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (c = 0; b->type->maintenance[c].number; ++c) {
|
for (c = 0; b->type->maintenance[c].number; ++c) {
|
||||||
const maintenance *m = b->type->maintenance + c;
|
const maintenance *m = b->type->maintenance + c;
|
||||||
int cost = m->number;
|
int cost = m->number;
|
||||||
|
@ -1118,8 +1123,7 @@ static bool maintain(building * b, bool first)
|
||||||
assert(cost == 0);
|
assert(cost == 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ADDMSG(&u->faction->msgs,
|
ADDMSG(&u->faction->msgs, msg_message("maintenancefail", "unit building", u, b));
|
||||||
msg_message("maintenancefail", "unit building", u, b));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue