From 413f70d1a1b429813bcc0e9b141ecaf4c5ed1cc7 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 16 Nov 2016 22:30:59 +0100 Subject: [PATCH] move market function out of config.c --- src/creport.c | 1 + src/kernel/config.c | 5 ----- src/kernel/config.h | 1 - src/market.c | 5 +++++ src/market.h | 3 ++- src/modules/autoseed.c | 2 ++ src/report.c | 3 ++- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/creport.c b/src/creport.c index becee2cb0..b74c5cdef 100644 --- a/src/creport.c +++ b/src/creport.c @@ -11,6 +11,7 @@ without prior permission by the authors of Eressea. #include #include #include "creport.h" +#include "market.h" #include "guard.h" #include "travelthru.h" diff --git a/src/kernel/config.c b/src/kernel/config.c index 78af1ad02..d8be01ed9 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -1061,11 +1061,6 @@ int rule_give(void) return rule; } -bool markets_module(void) -{ - return (bool)config_get_int("modules.markets", 0); -} - static struct param *configuration; static int config_cache_key = 1; diff --git a/src/kernel/config.h b/src/kernel/config.h index ca83be114..9a0d1d1fb 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -114,7 +114,6 @@ struct param; #define GF_PURE 64 /* untranslated */ - bool markets_module(void); int wage(const struct region *r, const struct faction *f, const struct race *rc, int in_turn); diff --git a/src/market.c b/src/market.c index efcaf0d98..cef84b9b2 100644 --- a/src/market.c +++ b/src/market.c @@ -85,6 +85,11 @@ static int rc_herb_trade(const struct race *rc) #define MAX_MARKETS 128 #define MIN_PEASANTS 50 /* if there are at least this many peasants, you will get 1 good */ +bool markets_module(void) +{ + return (bool)config_get_int("modules.markets", 0); +} + void do_markets(void) { quicklist *traders = 0; diff --git a/src/market.h b/src/market.h index dd15253ef..a74c88391 100644 --- a/src/market.h +++ b/src/market.h @@ -17,7 +17,8 @@ extern "C" { #endif struct building; - extern void do_markets(void); + bool markets_module(void); + void do_markets(void); #ifdef __cplusplus } diff --git a/src/modules/autoseed.c b/src/modules/autoseed.c index 3bcf36848..5420406c0 100644 --- a/src/modules/autoseed.c +++ b/src/modules/autoseed.c @@ -14,6 +14,8 @@ #include #include "autoseed.h" +#include "market.h" + /* kernel includes */ #include #include diff --git a/src/report.c b/src/report.c index 23dcadb34..80ac85974 100644 --- a/src/report.c +++ b/src/report.c @@ -25,8 +25,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "reports.h" #include "guard.h" #include "laws.h" -#include "travelthru.h" +#include "market.h" #include "monster.h" +#include "travelthru.h" /* modules includes */ #include