From 65e43c2ab18a446102dea9237cfd4152392d7f33 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 10 May 2014 17:46:37 +0200 Subject: [PATCH] Moved MAX_CARTS and NEW_CARTS defines into common/mmo.h - Fixes bugreport:8184, allowing re-commit of 94657284973f4037596bae468ebfbee5c217e02b Signed-off-by: Haru --- src/common/mmo.h | 8 ++++++++ src/config/const.h | 8 -------- src/config/renewal.h | 12 +++++++++++- src/map/atcommand.c | 4 ++-- src/map/clif.c | 3 ++- src/map/pc.c | 6 +++--- src/map/pc.h | 2 +- src/map/script.c | 3 ++- src/map/status.h | 4 ++-- 9 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/common/mmo.h b/src/common/mmo.h index 1d826463ef8..0003aa917e1 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -84,6 +84,14 @@ #endif // 20090603 #endif // 20070227 +/* Feb 1st 2012 */ +#if PACKETVER >= 20120201 +# define NEW_CARTS +# define MAX_CARTS 9 +#else +# define MAX_CARTS 5 +#endif + #define MAX_INVENTORY 100 //Max number of characters per account. Note that changing this setting alone is not enough if the client is not hexed to support more characters as well. #define MAX_CHARS 9 diff --git a/src/config/const.h b/src/config/const.h index f9baa4d7d89..ba06d70cbd0 100644 --- a/src/config/const.h +++ b/src/config/const.h @@ -87,14 +87,6 @@ #define RE_LVL_TMDMOD() #endif -/* Feb 1st 2012 */ -#if PACKETVER >= 20120201 - #define NEW_CARTS - #define MAX_CARTS 9 -#else - #define MAX_CARTS 5 -#endif - // Renewal variable cast time reduction #ifdef RENEWAL_CAST #define VARCAST_REDUCTION(val) do { \ diff --git a/src/config/renewal.h b/src/config/renewal.h index 36bdd39589e..1c48b9f8ae1 100644 --- a/src/config/renewal.h +++ b/src/config/renewal.h @@ -13,8 +13,18 @@ * @INFO: This file holds general-purpose renewal settings, for class-specific ones check /src/config/classes folder **/ +/** + * Renewal full toggle switch. + * + * Uncomment this line to disable all of the below settings at once. + * Note: in UNIX builds, this can be easily done without touching this + * line, by passing --disable-renewal to the configure script: + * ./configure --disable-renewal + */ //#define DISABLE_RENEWAL -#ifndef DISABLE_RENEWAL + + +#ifndef DISABLE_RENEWAL // Do not change this line /// game renewal server mode /// (disable by commenting the line) diff --git a/src/map/atcommand.c b/src/map/atcommand.c index df3be40a599..7a6ad84e446 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -4,7 +4,7 @@ #define HERCULES_CORE -#include "../config/core.h" // AUTOLOOTITEM_SIZE, AUTOTRADE_PERSISTENCY, MAX_CARTS, MAX_SUGGESTIONS, MOB_FLEE(), MOB_HIT(), RENEWAL, RENEWAL_DROP, RENEWAL_EXP +#include "../config/core.h" // AUTOLOOTITEM_SIZE, AUTOTRADE_PERSISTENCY, MAX_SUGGESTIONS, MOB_FLEE(), MOB_HIT(), RENEWAL, RENEWAL_DROP, RENEWAL_EXP #include "atcommand.h" #include @@ -45,7 +45,7 @@ #include "../common/conf.h" #include "../common/core.h" #include "../common/malloc.h" -#include "../common/mmo.h" +#include "../common/mmo.h" // MAX_CARTS #include "../common/nullpo.h" #include "../common/random.h" #include "../common/showmsg.h" diff --git a/src/map/clif.c b/src/map/clif.c index cb2474961c5..068cb1e0757 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4,7 +4,7 @@ #define HERCULES_CORE -#include "../config/core.h" // ANTI_MAYAP_CHEAT, NEW_CARTS, RENEWAL, SECURE_NPCTIMEOUT +#include "../config/core.h" // ANTI_MAYAP_CHEAT, RENEWAL, SECURE_NPCTIMEOUT #include "clif.h" #include @@ -48,6 +48,7 @@ #include "../common/ers.h" #include "../common/grfio.h" #include "../common/malloc.h" +#include "../common/mmo.h" // NEW_CARTS #include "../common/nullpo.h" #include "../common/random.h" #include "../common/showmsg.h" diff --git a/src/map/pc.c b/src/map/pc.c index 45adfe22aa8..08ff8baf9f5 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4,7 +4,7 @@ #define HERCULES_CORE -#include "../config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_CARTS, MAX_SPIRITBALL, NEW_CARTS, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT +#include "../config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_SPIRITBALL, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT #include "pc.h" #include @@ -45,7 +45,7 @@ #include "../common/conf.h" #include "../common/core.h" // get_svn_revision() #include "../common/malloc.h" -#include "../common/mmo.h" //NAME_LENGTH +#include "../common/mmo.h" // NAME_LENGTH, MAX_CARTS, NEW_CARTS #include "../common/nullpo.h" #include "../common/random.h" #include "../common/showmsg.h" @@ -8039,7 +8039,7 @@ int pc_setoption(struct map_session_data *sd,int type) *------------------------------------------*/ int pc_setcart(struct map_session_data *sd,int type) { #ifndef NEW_CARTS - int cart[6] = {0x0000,OPTION_CART1,OPTION_CART2,OPTION_CART3,OPTION_CART4,OPTION_CART5}; + int cart[6] = {OPTION_NOTHING,OPTION_CART1,OPTION_CART2,OPTION_CART3,OPTION_CART4,OPTION_CART5}; int option; #endif nullpo_ret(sd); diff --git a/src/map/pc.h b/src/map/pc.h index c4026a48d0f..5d723fcf8b7 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -21,7 +21,7 @@ #include "vending.h" // struct s_vending #include "../common/cbasetypes.h" #include "../common/ers.h" // struct eri -#include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus +#include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus, NEW_CARTS /** * Defines diff --git a/src/map/script.c b/src/map/script.c index 068be852475..4195e40fce6 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4,7 +4,7 @@ #define HERCULES_CORE -#include "../config/core.h" // NEW_CARTS, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL +#include "../config/core.h" // RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL #include "script.h" #include @@ -45,6 +45,7 @@ #include "../common/cbasetypes.h" #include "../common/malloc.h" #include "../common/md5calc.h" +#include "../common/mmo.h" // NEW_CARTS #include "../common/nullpo.h" #include "../common/random.h" #include "../common/showmsg.h" diff --git a/src/map/status.h b/src/map/status.h index baa586297fb..6bb563b0bd8 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -5,10 +5,10 @@ #ifndef _MAP_STATUS_H_ #define _MAP_STATUS_H_ -#include "../config/core.h" // defType, NEW_CARTS, RENEWAL, RENEWAL_ASPD +#include "../config/core.h" // defType, RENEWAL, RENEWAL_ASPD #include "../common/cbasetypes.h" -#include "../common/mmo.h" +#include "../common/mmo.h" // NEW_CARTS struct block_list; struct elemental_data;