From 90d59a8aa75707d119fcee42eff96c6b3ad3c25c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 3 Oct 2009 08:47:33 +0000 Subject: [PATCH] support old rules (eressea 1.0 magic) --- src/common/kernel/magic.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/common/kernel/magic.c b/src/common/kernel/magic.c index e7b4d601c..56e58dea0 100644 --- a/src/common/kernel/magic.c +++ b/src/common/kernel/magic.c @@ -389,12 +389,16 @@ static boolean know_school(const faction * f, magic_t school) static int common = MAXMAGIETYP; if (f->magiegebiet==school) return true; if (common==MAXMAGIETYP) { - const char * school = get_param(global.parameters, "rules.magic.common"); - for (common=0;common!=MAXMAGIETYP;++common) { - if (strcmp(school, magic_school[common])==0) break; - } - if (common==MAXMAGIETYP) { - common = M_NONE; + const char * common_school = get_param(global.parameters, "rules.magic.common"); + if (common_school) { + for (common=0;common!=MAXMAGIETYP;++common) { + if (strcmp(common_school, magic_school[common])==0) break; + } + if (common==MAXMAGIETYP) { + common = M_NONE; + } + } else { + return false; } } return school==common;