From 39253de1b1335b0c9f71d5bc31c1a6b5a95f6940 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Sun, 21 Nov 2010 16:20:26 +0000 Subject: * Added enumeration RC2_* for mob data 'race2' (bugreport:4561). - Fixed race2-related bonus arrays using RC_MAX, rather than race2 maximum (since r6221, related r1277). - Fixed bSubRace2 lacking bounds check (since r1257). - Fixed bSubRace2 being documented as bSPSubRace2 (since r1257). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14480 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index e93ae8a93..c52a61003 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -27,7 +27,6 @@ #include "homunculus.h" #include "instance.h" #include "mercenary.h" -#include "mob.h" // MAX_MOB_RACE_DB #include "npc.h" // fake_nd #include "pet.h" // pet_unlocktarget() #include "party.h" // party_search() @@ -2741,7 +2740,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) } break; case SP_ADDRACE2: - if (!(type2 > 0 && type2 < MAX_MOB_RACE_DB)) + if (!(type2 > RC2_NONE && type2 < RC2_MAX)) break; if(sd->state.lr_flag != 2) sd->right_weapon.addrace2[type2] += val; @@ -2753,6 +2752,8 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) sd->subsize[type2]+=val; break; case SP_SUBRACE2: + if (!(type2 > RC2_NONE && type2 < RC2_MAX)) + break; if(sd->state.lr_flag != 2) sd->subrace2[type2]+=val; break; -- cgit v1.2.3-60-g2f50