From 03ada4b5472b18b672ba46abe4be13f6bd2445f9 Mon Sep 17 00:00:00 2001 From: lighta Date: Wed, 4 Sep 2013 18:45:11 -0400 Subject: [PATCH] Quickfixs Fix bugreport:8035 (SC_ENERVATION altening twice watk) Upd config.pl enable coredump part to reload sysconfig once altered. --- src/common/conf.h | 2 +- src/map/status.c | 7 ++----- src/map/unit.c | 6 +++++- tools/config.pl | 2 ++ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/common/conf.h b/src/common/conf.h index 666853ba6d..d223505dba 100644 --- a/src/common/conf.h +++ b/src/common/conf.h @@ -5,7 +5,7 @@ #define _CONF_H_ #include "../common/cbasetypes.h" -#include "libconfig.h" +#include "../../3rdparty/libconfig/libconfig.h" int conf_read_file(config_t *config, const char *config_filename); int config_setting_copy(config_setting_t *parent, const config_setting_t *src); diff --git a/src/map/status.c b/src/map/status.c index 69347e6956..c8506ba215 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4699,8 +4699,6 @@ static unsigned short status_calc_watk(struct block_list *bl, struct status_chan watk -= watk * 25/100; if(sc->data[SC_STRIPWEAPON] && bl->type != BL_PC) watk -= watk * sc->data[SC_STRIPWEAPON]->val2/100; - if(sc->data[SC__ENERVATION]) - watk -= watk * sc->data[SC__ENERVATION]->val2 / 100; if((sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 2) || (sc->data[SC_WATER_INSIGNIA] && sc->data[SC_WATER_INSIGNIA]->val1 == 2) || (sc->data[SC_WIND_INSIGNIA] && sc->data[SC_WIND_INSIGNIA]->val1 == 2) @@ -4957,7 +4955,7 @@ static defType status_calc_def(struct block_list *bl, struct status_change *sc, if(!sc || !sc->count) return (defType)cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX); - + if(sc->data[SC_DEFSET]) //FIXME: Find out if this really overrides all other SCs return sc->data[SC_DEFSET]->val1; if(sc->data[SC_BERSERK]) @@ -5099,7 +5097,7 @@ static defType status_calc_mdef(struct block_list *bl, struct status_change *sc, if(!sc || !sc->count) return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX); - + if(sc->data[SC_MDEFSET]) //FIXME: Find out if this really overrides all other SCs return sc->data[SC_MDEFSET]->val1; if(sc->data[SC_BERSERK]) @@ -8419,7 +8417,6 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty sc_start(src,bl,SC_STRIPWEAPON,100,val1,tick); sc_start(src,bl,SC_STRIPSHIELD,100,val1,tick); break; - break; case SC_GN_CARTBOOST: if( val1 < 3 ) val2 = 50; diff --git a/src/map/unit.c b/src/map/unit.c index 227a811c1b..002b85fc59 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -114,7 +114,11 @@ int unit_walktoxy_sub(struct block_list *bl) } - +/** + * Retrieve the direct master of a bl if he have one. + * @param bl: char to get his master + * @return map_session_data of master or NULL + */ TBL_PC* unit_get_master(struct block_list *bl){ if(bl) switch(bl->type){ diff --git a/tools/config.pl b/tools/config.pl index 671bc3a54c..b2f266fa5d 100755 --- a/tools/config.pl +++ b/tools/config.pl @@ -123,6 +123,7 @@ sub EnableCoredump { $sJump=1 if(GetValidAnwser("y|o|n") =~ /n/i); } system("sudo echo \"ulimit -c unlimited\" >> $sCurfile") unless $sJump==1; + #FIXME centos need to alter /etc/security/limits.conf $sCurfile = "/etc/sysctl.conf"; @lines = (); @@ -140,6 +141,7 @@ sub EnableCoredump { system('sudo su root -c "echo \"echo kernel.core_uses_pid = 1 >> /etc/sysctl.conf\" | sudo bash"'); system('sudo su root -c "echo \"echo kernel.core_pattern = /tmp/core-%e-%s-%u-%g-%p-%t >> /etc/sysctl.conf\" | sudo bash"'); system('sudo su root -c "echo \"echo fs.suid_dumpable = 1 >> /etc/sysctl.conf\" | sudo bash"'); + system('sudo su root -c "sysctl -p"'); } }