From 73fa9a276d4fd51a2c473269c705caad6065e901 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 22 May 2015 16:23:18 +0200 Subject: [PATCH] Make GiveRestriction default to 0, do not cache the value in a static variable. --- scripts/tests/pool.lua | 1 - src/give.c | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/tests/pool.lua b/scripts/tests/pool.lua index b89d180fa..2ac9c87f2 100644 --- a/scripts/tests/pool.lua +++ b/scripts/tests/pool.lua @@ -8,7 +8,6 @@ function setup() eressea.settings.set("rules.economy.food", "0") eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") - eressea.settings.set("GiveRestriction", "0") eressea.settings.set("rules.magic.playerschools", "") conf = [[{ "races": { diff --git a/src/give.c b/src/give.c index d211a5518..646770074 100644 --- a/src/give.c +++ b/src/give.c @@ -57,12 +57,7 @@ static int max_transfers(void) { static int GiveRestriction(void) { - static int value = -1; - if (value < 0) { - const char *str = get_param(global.parameters, "GiveRestriction"); - value = str ? atoi(str) : 0; - } - return value; + return get_param_int(global.parameters, "GiveRestriction", 0); } static void feedback_give_not_allowed(unit * u, order * ord)