From 1daa6fd65b2e29deef901107a24e6feedb02f6ba Mon Sep 17 00:00:00 2001 From: aleos89 Date: Wed, 27 Jul 2016 18:56:17 -0400 Subject: [PATCH] Revert of efdc748 * Going to follow up later with a better fix. --- src/map/pc.c | 2 +- src/map/status.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/map/pc.c b/src/map/pc.c index 0d2382ae14..afaee32ca8 100755 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3132,7 +3132,7 @@ void pc_bonus2(struct map_session_data *sd,int type,int type2,int val) sd->state.lr_flag != 2 ? val : 0, sd->state.lr_flag == 2 ? val : 0, ATF_SELF, 0); break; case SP_RESEFF: // bonus2 bResEff,eff,n; - if (type2 <= SC_NONE || type2 >= SC_MAX) { + if (type2 < SC_COMMON_MIN || type2 > SC_COMMON_MAX) { ShowError("pc_bonus2: SP_RESEFF: %d is invalid effect.\n", type2); break; } diff --git a/src/map/status.c b/src/map/status.c index 328ecd6f42..fbd80665dd 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -7735,12 +7735,9 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ } // Item resistance (only applies to rate%) - // TODO: Need to come up with a better way of flagging "common" SC rather than setting them at the start of sc_enum - if(sd && type > SC_NONE && type < SC_MAX) { - if( sd->reseff[type] > 0 ) - rate -= ((rate*sd->reseff[type])/10000); - } if(sd && SC_COMMON_MIN <= type && type <= SC_COMMON_MAX) { + if( sd->reseff[type-SC_COMMON_MIN] > 0 ) + rate -= rate*sd->reseff[type-SC_COMMON_MIN]/10000; if( sd->sc.data[SC_COMMONSC_RESIST] ) rate -= rate*sd->sc.data[SC_COMMONSC_RESIST]->val1/100; }