From 34b1ead0acf5479274f0774c1ffb37704fda3e05 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. --- src/give.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/give.c b/src/give.c index d22a09c73..3f8f62927 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)