From a29e6a7f40be059b22ba39a59c153b71eef623f8 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 31 Oct 2014 22:20:07 +0100 Subject: [PATCH] fix segmentation fault in new assert (units without a faction) --- conf/eressea.ini | 27 ++++++++++++++------------- src/kernel/unit.c | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/conf/eressea.ini b/conf/eressea.ini index 6834005cc..1bc14283d 100644 --- a/conf/eressea.ini +++ b/conf/eressea.ini @@ -1,18 +1,19 @@ + [eressea] -base = . -report = reports -verbose = 0 -lomem = 0 -debug = 0 -memcheck = 0 -locales = de,en -;game_id = 0 +base = . +report = reports +verbose = 0 +lomem = 0 +debug = 0 +memcheck = 0 +locales = de,en [lua] -install = ../git -paths = ../git/lunit:../git/scripts -maxnmrs = 20 -rules = e2 ; can use -r to override +install = ../git +paths = lunit:scripts +maxnmrs = 20 +rules = e2 [editor] -color = 1 +color = 1 + diff --git a/src/kernel/unit.c b/src/kernel/unit.c index 6e7f1eaa0..65b3bd4bb 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -702,7 +702,7 @@ void set_level(unit * u, skill_t sk, int value) { skill *sv = u->skills; - assert(sk != SK_MAGIC || is_monsters(u->faction) || u->number == 1); + assert(sk != SK_MAGIC || !u->faction || is_monsters(u->faction) || u->number == 1); if (!skill_enabled(sk)) return;