Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion process/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
install(PROGRAMS create-orders backup-box backup-onedrive
run-turn send-zip-report
run-turn send-zip-report updatelist.sh
send-bz2-report compress.py compress.sh epasswd.py
accept-orders.py getemail.py checkpasswd.py
sendreport.sh sendreports.sh orders-accept DESTINATION bin)
Expand Down
1 change: 1 addition & 0 deletions process/cron/run-eressea.cron
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ backup BACKUP "$GAME" "$TURN"
upload "$BACKUP"
rm -f execute.lock
"$BIN/run-turn" "$GAME" "$TURN"
"$BIN/updatelist.sh" "$TURN"
touch execute.lock

(( NEXTTURN=TURN+1 )) || true
Expand Down
9 changes: 9 additions & 0 deletions process/updatelist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

TURN=$1
LIST=eressea-announce@kn-bremen.de
awk '{ if ($2 =="'$TURN'") print $5 }' deadlog.txt |\
mailman delmembers -f- -l$LIST
tail reports/reports.txt | cut -d: -f2 | sed -e 's/email=//' | \
mailman addmembers - $LIST

16 changes: 9 additions & 7 deletions src/bind_region.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,17 @@ static int tolua_region_has_border(lua_State *L)
if (btype) {
direction_t dir = (direction_t)tolua_tonumber(L, 3, 0);
region *r2 = rconnect(r, dir);
connection *b;
for (b = get_borders(r, r2); b; b = b->next) {
if (b->type == btype) {
lua_pushboolean(L, true);
return 1;
if (r2) {
connection *b;
for (b = get_borders(r, r2); b; b = b->next) {
if (b->type == btype) {
lua_pushboolean(L, true);
return 1;
}
}
lua_pushboolean(L, false);
return 1;
}
lua_pushboolean(L, false);
return 1;
}
return 0;
}
Expand Down
7 changes: 5 additions & 2 deletions src/kernel/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ static connection **get_borders_i(const region * r1, const region * r2)

connection *get_borders(const region * r1, const region * r2)
{
connection **bp = get_borders_i(r1, r2);
return *bp;
if (r1 && r2) {
connection **bp = get_borders_i(r1, r2);
return *bp;
}
return NULL;
}

connection *border_create(region *from)
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/ship.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ unit *ship_owner(const ship * sh)
{
if (sh->number > 0) {
unit *owner = sh->_owner;
if (!owner || owner->ship != sh) {
if (!owner || owner->ship != sh || owner->number <= 0) {
unit * heir = ship_owner_ex(sh, owner ? owner->faction : NULL);
return (heir && heir->number > 0) ? heir : NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/ship.test.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static void test_shipowner_goes_to_other_when_empty(CuTest * tc)
u_set_ship(u, sh);
u_set_ship(u2, sh);
CuAssertPtrEquals(tc, u, ship_owner(sh));
leave_ship(u);
u->number = 0;
CuAssertPtrEquals(tc, u2, ship_owner(sh));
test_teardown();
}
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#ifndef ERESSEA_VERSION
/* the version number, if it was not passed to make with -D */
#define ERESSEA_VERSION "30.4.0"
#define ERESSEA_VERSION "31.1.0"
#endif

const char *eressea_version(void) {
Expand Down
6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static int parse_args(int argc, char **argv)
case 'l':
i = get_arg(argc, argv, 2, i, &arg, NULL);
if (arg) {
log_flags = arg ? atoi(arg) : 0xff;
log_flags = atoi(arg);
} else {
return usage(argv[0], NULL);
}
Expand All @@ -263,7 +263,7 @@ static int parse_args(int argc, char **argv)
case 'w':
i = get_arg(argc, argv, 2, i, &arg, NULL);
if (arg) {
bcrypt_workfactor = arg ? atoi(arg) : 0xff;
bcrypt_workfactor = atoi(arg);
} else {
return usage(argv[0], NULL);
}
Expand All @@ -274,7 +274,7 @@ static int parse_args(int argc, char **argv)
case 'v':
i = get_arg(argc, argv, 2, i, &arg, NULL);
if (arg) {
verbosity = arg ? atoi(arg) : 0xff;
verbosity = atoi(arg);
}
break;
case 'h':
Expand Down
16 changes: 9 additions & 7 deletions src/summary.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ static int cmp_nmr_faction(const void *a, const void *b)
static void report_nmrs(FILE *F, int timeout)
{
nmr_faction *nmrs = NULL;
size_t len, i;
faction *f;
for (f = factions; f; f = f->next) {
if (turn - 1 - f->lastorders > 0) {
Expand All @@ -257,13 +256,16 @@ static void report_nmrs(FILE *F, int timeout)
nmr->nmr = turn - 1 - f->lastorders;
}
}
len = arrlen(nmrs);
qsort(nmrs, len, sizeof(struct nmr_faction), cmp_nmr_faction);
fprintf(F, "\n\nFactions with NMRs:\n");
for (i = 0; i != len; ++i) {
out_faction(F, nmrs[i].f);
if (nmrs) {
size_t len, i;
len = arrlen(nmrs);
qsort(nmrs, len, sizeof(struct nmr_faction), cmp_nmr_faction);
fprintf(F, "\n\nFactions with NMRs:\n");
for (i = 0; i != len; ++i) {
out_faction(F, nmrs[i].f);
}
arrfree(nmrs);
}
arrfree(nmrs);
}

void report_summary(const summary * s, bool full)
Expand Down
Loading