forked from github/server
Merge pull request #20 from CTD1/Bug-1664
Bug 1664: Obwohl kein Holz vorhanden ist, kommt die Meldung, daß der Unt...
This commit is contained in:
commit
75e98ae0cb
|
@ -1055,9 +1055,9 @@ static bool maintain(building * b, bool first)
|
|||
}
|
||||
}
|
||||
if (need > 0) {
|
||||
if (!fval(m, MTF_VITAL))
|
||||
work = false;
|
||||
else {
|
||||
if (fval(m, MTF_VITAL))
|
||||
{
|
||||
paid = false;
|
||||
break;
|
||||
}
|
||||
|
@ -1066,16 +1066,21 @@ static bool maintain(building * b, bool first)
|
|||
}
|
||||
if (paid && c > 0) {
|
||||
/* TODO: wieviel von was wurde bezahlt */
|
||||
if (first) {
|
||||
ADDMSG(&u->faction->msgs, msg_message("maintenance", "unit building", u,
|
||||
b));
|
||||
} else {
|
||||
ADDMSG(&u->faction->msgs, msg_message("maintenance_late", "building", b));
|
||||
}
|
||||
fset(b, BLD_MAINTAINED);
|
||||
if (work) {
|
||||
if (first && work) {
|
||||
ADDMSG(&u->faction->msgs, msg_message("maintenance", "unit building", u, b));
|
||||
fset(b, BLD_WORKING);
|
||||
fset(b, BLD_MAINTAINED);
|
||||
}
|
||||
if (!first) {
|
||||
ADDMSG(&u->faction->msgs, msg_message("maintenance_late", "building", b));
|
||||
fset(b, BLD_MAINTAINED);
|
||||
}
|
||||
|
||||
if (first && !work) {
|
||||
ADDMSG(&u->faction->msgs, msg_message("maintenancefail", "unit building", u, b));
|
||||
return false;
|
||||
}
|
||||
|
||||
for (c = 0; b->type->maintenance[c].number; ++c) {
|
||||
const maintenance *m = b->type->maintenance + c;
|
||||
int cost = m->number;
|
||||
|
@ -1114,8 +1119,7 @@ static bool maintain(building * b, bool first)
|
|||
assert(cost == 0);
|
||||
}
|
||||
} else {
|
||||
ADDMSG(&u->faction->msgs,
|
||||
msg_message("maintenancefail", "unit building", u, b));
|
||||
ADDMSG(&u->faction->msgs, msg_message("maintenancefail", "unit building", u, b));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue