summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorpanikon <panikon@zoho.com>2014-07-09 06:29:03 -0300
committerpanikon <panikon@zoho.com>2014-07-09 07:09:37 -0300
commit1eee0fd015aaca31df67f0cc7fa36105ade366df (patch)
tree1475ccfd8b7c6f3756768d7006afef74dd14f0f7 /src/map/pc.c
parentfc41d1f9fa9f3eff21568c8111f74454793dea9c (diff)
downloadhercules-1eee0fd015aaca31df67f0cc7fa36105ade366df.tar.gz
hercules-1eee0fd015aaca31df67f0cc7fa36105ade366df.tar.bz2
hercules-1eee0fd015aaca31df67f0cc7fa36105ade366df.tar.xz
hercules-1eee0fd015aaca31df67f0cc7fa36105ade366df.zip
Fixed issue with mounts and jobchange, ranger and mechanic mounts weren't being checked and properly removed in pc_setoption
Abstracted running functions into two other methods (unit_run and unit_wugdash) Added checks in skill_dance_switch so it'd be safe to call it whenever it's needed Documented unit_run, unit_run_hit, skill_dance_switch and sc_conf_type
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 3afb6c556..47744a839 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7982,22 +7982,21 @@ int pc_setoption(struct map_session_data *sd,int type)
else if (!(type&OPTION_FALCON) && p_type&OPTION_FALCON) //Falcon OFF
clif->sc_end(&sd->bl,sd->bl.id,AREA,SI_FALCON);
- if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER ) {
- if( type&OPTION_WUGRIDER && !(p_type&OPTION_WUGRIDER) ) { // Mounting
- clif->sc_load(&sd->bl,sd->bl.id,AREA,SI_WUGRIDER, 0, 0, 0);
- status_calc_pc(sd,SCO_NONE);
- } else if( !(type&OPTION_WUGRIDER) && p_type&OPTION_WUGRIDER ) { // Dismount
- clif->sc_end(&sd->bl,sd->bl.id,AREA,SI_WUGRIDER);
- status_calc_pc(sd,SCO_NONE);
- }
+ if( type&OPTION_WUGRIDER && !(p_type&OPTION_WUGRIDER) ) { // Mounting
+ clif->sc_load(&sd->bl,sd->bl.id,AREA,SI_WUGRIDER, 0, 0, 0);
+ status_calc_pc(sd,SCO_NONE);
+ } else if( !(type&OPTION_WUGRIDER) && p_type&OPTION_WUGRIDER ) { // Dismount
+ clif->sc_end(&sd->bl,sd->bl.id,AREA,SI_WUGRIDER);
+ status_calc_pc(sd,SCO_NONE);
}
- if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) {
+
+ if( (type&OPTION_MADOGEAR && !(p_type&OPTION_MADOGEAR))
+ || (!(type&OPTION_MADOGEAR) && p_type&OPTION_MADOGEAR) ) {
int i;
- if( type&OPTION_MADOGEAR && !(p_type&OPTION_MADOGEAR) )
- status_calc_pc(sd, SCO_NONE);
- else if( !(type&OPTION_MADOGEAR) && p_type&OPTION_MADOGEAR )
- status_calc_pc(sd, SCO_NONE);
- for( i = 0; i < SC_MAX; i++ ){
+ status_calc_pc(sd, SCO_NONE);
+
+ // End all SCs that can be reset when mado is taken off
+ for( i = 0; i < SC_MAX; i++ ) {
if ( !sd->sc.data[i] || !status->get_sc_type(i) )
continue;
if ( status->get_sc_type(i)&SC_MADO_NO_RESET )