Merge branch 'master' into develop

This commit is contained in:
Enno Rehling 2018-09-09 07:50:25 +02:00
commit 41f9d32923
4 changed files with 13 additions and 6 deletions

View File

@ -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

View File

@ -30,7 +30,7 @@
</type>
</message>
<message name="target_region_invalid">
<message name="target_region_invalid" section="errors">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
@ -38,7 +38,7 @@
</type>
</message>
<message name="missing_direction">
<message name="missing_direction" section="errors">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
@ -46,7 +46,7 @@
</type>
</message>
<message name="target_region_not_empty">
<message name="target_region_not_empty" section="errors">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>

View File

@ -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;
}

View File

@ -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)