enhancement: buildings without an owner report their lack of upkeep to the entire region.

https://bugs.eressea.de/view.php?id=1713
This commit is contained in:
Enno Rehling 2014-12-14 11:48:15 +01:00
parent 3ac407407a
commit 27b1d55350
2 changed files with 11 additions and 3 deletions

View File

@ -7164,15 +7164,20 @@
<arg name="building" type="building"/>
</type>
<text locale="de">"$unit($unit) kann den Unterhalt von $building($building) nicht bezahlen."</text>
<text locale="fr">"$unit($unit) cannot pay the maintenance for $building($building)."</text>
<text locale="en">"$unit($unit) cannot pay the maintenance for $building($building)."</text>
</message>
<message name="maintenance_noowner" section="errors">
<type>
<arg name="building" type="building"/>
</type>
<text locale="de">"Der Unterhalt von $building($building) konnte nicht gezahlt werden, das Gebäude war diese Woche nicht funktionstüchtig."</text>
<text locale="en">"The upkeep for $building($building) was not paid, the building was not operational this week."</text>
</message>
<message name="maintenance_late" section="errors">
<type>
<arg name="building" type="building"/>
</type>
<text locale="de">"Der Unterhalt von $building($building) konnte nur verspätet gezahlt werden, das Gebäude war diese Woche nicht funktionstüchtig."</text>
<text locale="fr">"The upkeep for $building($building) was paid late, the building was not operational this week."</text>
<text locale="en">"The upkeep for $building($building) was paid late, the building was not operational this week."</text>
</message>
<message name="income_tradetax" section="economy">

View File

@ -734,8 +734,11 @@ static bool maintain(building * b, bool first)
return false;
}
u = building_owner(b);
if (u == NULL)
if (u == NULL) {
/* no owner - send a message to the entire region */
ADDMSG(&r->msgs, msg_message("maintenance_noowner", "building", b));
return false;
}
/* If the owner is the region owner, check if dontpay flag is set for the building where he is in */
if (check_param(global.parameters, "rules.region_owner_pay_building", b->type->_name)) {
if (fval(u->building, BLD_DONTPAY)) {