From 27b1d5535033c21d1213235b6c2608f0c52cb243 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 14 Dec 2014 11:48:15 +0100 Subject: [PATCH] enhancement: buildings without an owner report their lack of upkeep to the entire region. https://bugs.eressea.de/view.php?id=1713 --- res/core/messages.xml | 9 +++++++-- src/economy.c | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/res/core/messages.xml b/res/core/messages.xml index e65d89d1e..409e2ee09 100644 --- a/res/core/messages.xml +++ b/res/core/messages.xml @@ -7164,15 +7164,20 @@ "$unit($unit) kann den Unterhalt von $building($building) nicht bezahlen." - "$unit($unit) cannot pay the maintenance for $building($building)." "$unit($unit) cannot pay the maintenance for $building($building)." + + + + + "Der Unterhalt von $building($building) konnte nicht gezahlt werden, das Gebäude war diese Woche nicht funktionstüchtig." + "The upkeep for $building($building) was not paid, the building was not operational this week." + "Der Unterhalt von $building($building) konnte nur verspätet gezahlt werden, das Gebäude war diese Woche nicht funktionstüchtig." - "The upkeep for $building($building) was paid late, the building was not operational this week." "The upkeep for $building($building) was paid late, the building was not operational this week." diff --git a/src/economy.c b/src/economy.c index 60bea437d..2553a973d 100644 --- a/src/economy.c +++ b/src/economy.c @@ -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)) {