From b3edd8dc5ac574b79c930cd476f81c501c11683b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 29 Oct 2015 18:55:47 +0100 Subject: [PATCH 1/2] anerror in this bugfix was found by a lua test. sweet! --- src/bind_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bind_storage.c b/src/bind_storage.c index d82ccd07f..dd67d93a8 100644 --- a/src/bind_storage.c +++ b/src/bind_storage.c @@ -36,7 +36,7 @@ static int tolua_storage_create(lua_State * L) FILE * F; F = fopen(filename, type); - if (!F) { + if (F) { gamedata *data = (gamedata *)calloc(1, sizeof(gamedata)); storage *store = (storage *)calloc(1, sizeof(storage)); data->store = store; From 4eb6a89821f5355076338a0dcc77d5ddf6f1c67b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 29 Oct 2015 20:39:44 +0100 Subject: [PATCH 2/2] CID 26262: short and unsigned types are the devil, use int everywhere for fewer headaches --- src/kernel/unit.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kernel/unit.h b/src/kernel/unit.h index 86d4c08e4..606bccbcf 100644 --- a/src/kernel/unit.h +++ b/src/kernel/unit.h @@ -89,11 +89,11 @@ extern "C" { struct faction *faction; struct building *building; struct ship *ship; - unsigned short number; /* persons */ - short age; + int number; /* persons */ + int age; /* skill data */ - short skill_size; + int skill_size; struct skill *skills; struct item *items; reservation *reservations;