From aaf8668257c81b808628f5c90712fe45b20903aa Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 26 Apr 2008 16:48:50 +0000 Subject: [PATCH] fixes duplicate planes (again) --- src/common/kernel/save.c | 2 +- src/eressea/lua/gamecode.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index db8143b51..c202db593 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -1612,7 +1612,7 @@ readgame(const char * filename, int mode, int backup) int id = store->r_int(store); plane *pl = getplanebyid(id); if (pl==NULL) { - calloc(1, sizeof(plane)); + pl = calloc(1, sizeof(plane)); } else { log_warning(("the plane with id=%d already exists.\n", id)); } diff --git a/src/eressea/lua/gamecode.cpp b/src/eressea/lua/gamecode.cpp index 55796a359..f9080572e 100644 --- a/src/eressea/lua/gamecode.cpp +++ b/src/eressea/lua/gamecode.cpp @@ -131,8 +131,10 @@ read_game(const char * filename, const char * mode) int rv, m = IO_TEXT; if (strcmp(mode, "binary")==0) m = IO_BINARY; rv = readgame(filename, m, false); - log_printf(" - Korrekturen Runde %d\n", turn); - korrektur(); + if (rv==0) { + log_printf(" - Korrekturen Runde %d\n", turn); + korrektur(); + } return rv; }