diff --git a/process/backup-eressea b/process/backup-eressea index 4914f5af0..4e5f69002 100755 --- a/process/backup-eressea +++ b/process/backup-eressea @@ -28,6 +28,9 @@ if [ -e orders.$TURN ]; then files="$files orders.$TURN" fi echo "backup turn $TURN, game $GAME, files: $files" +if [ -d reports ] ; then + tar cjf backup/$TURN-reports.tar.bz2 reports +fi tar cjf backup/$TURN.tar.bz2 $files echo "uploading game-$GAME/$TURN.tar.bz2" curl -s -n -T backup/$TURN.tar.bz2 https://dav.box.com/dav/Eressea/game-$GAME/$TURN.tar.bz2 diff --git a/res/core/messages.xml b/res/core/messages.xml index 0cd66ca08..1e4e977e0 100644 --- a/res/core/messages.xml +++ b/res/core/messages.xml @@ -30,7 +30,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -46,7 +46,7 @@ - + diff --git a/src/economy.c b/src/economy.c index dc7e6148b..baba6c1ac 100644 --- a/src/economy.c +++ b/src/economy.c @@ -1666,7 +1666,7 @@ static void buy(unit * u, econ_request ** buyorders, struct order *ord) return; } } - if (r_demand(r, ltype)) { + if (!r->land || r_demand(r, ltype)) { ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "luxury_notsold", "")); return; } @@ -1708,6 +1708,7 @@ static void expandselling(region * r, econ_request * sellorders, int limit) static int bt_cache; static const struct building_type *castle_bt, *harbour_bt, *caravan_bt; + assert(r->land); if (bt_changed(&bt_cache)) { castle_bt = bt_find("castle"); harbour_bt = bt_find("harbour"); @@ -1977,7 +1978,7 @@ static bool sell(unit * u, econ_request ** sellorders, struct order *ord) econ_request *o; int k, available; - if (!r_demand(r, ltype)) { + if (!r->land || !r_demand(r, ltype)) { cmistake(u, ord, 263, MSG_COMMERCE); return false; } diff --git a/src/kernel/region.c b/src/kernel/region.c index 7cb52c201..29f7222e1 100644 --- a/src/kernel/region.c +++ b/src/kernel/region.c @@ -716,7 +716,10 @@ const item_type *r_luxury(const region * r) int r_demand(const region * r, const luxury_type * ltype) { - struct demand *d = r->land->demands; + struct demand *d; + + assert(r && r->land); + d = r->land->demands; while (d && d->type != ltype) d = d->next; if (!d)