summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-01-24 18:18:13 -0200
committershennetsind <ind@henn.et>2014-01-24 18:18:13 -0200
commit7438e401b4209198691d3c8ca65b6c702338fa41 (patch)
tree59b2f8f11d2a64d8eeb6a05f4e9fef074a1cf8c9 /src/map/clif.c
parentacc992ac2838f6380ebf2b2f8a514e86c2b750d9 (diff)
downloadhercules-7438e401b4209198691d3c8ca65b6c702338fa41.tar.gz
hercules-7438e401b4209198691d3c8ca65b6c702338fa41.tar.bz2
hercules-7438e401b4209198691d3c8ca65b6c702338fa41.tar.xz
hercules-7438e401b4209198691d3c8ca65b6c702338fa41.zip
Follow up e587d715cbc3
Fixed an issue where character position would not be instantly updated upon using a skill with casttime while in hiding (e.g. cloaking -> soul break), Special Thanks to Michieru! Turned the feature optional, by commenting out ANTI_MAYAP_CHEAT in src/config/secure.h due it not being entirely able to mimic skill casting out of hiding (read the description in secure.h for further details). Also fixed some status.c indentation which, unfortunately, considerably increased this commits size. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 975a5aa01..c0b3f7f7f 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1550,11 +1550,12 @@ void clif_walkok(struct map_session_data *sd)
void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *ud) {
+#ifdef ANTI_MAYAP_CHEAT
struct status_change *sc = NULL;
- if( (sc = status->get_sc(bl)) && sc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_INVISIBLE|OPTION_CHASEWALK) )
+ if( (sc = status->get_sc(bl)) && sc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_INVISIBLE) )
clif->ally_only = true;
-
+#endif
clif->set_unit_walking(bl,NULL,ud,AREA_WOS);
if(vd->cloth_color)
@@ -1585,8 +1586,9 @@ void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *u
clif->send_petdata(NULL, (TBL_PET*)bl, 3, vd->head_bottom);
break;
}
-
+#ifdef ANTI_MAYAP_CHEAT
clif->ally_only = false;
+#endif
}
@@ -1598,9 +1600,11 @@ void clif_move(struct unit_data *ud)
unsigned char buf[16];
struct view_data *vd;
struct block_list *bl = ud->bl;
+#ifdef ANTI_MAYAP_CHEAT
struct status_change *sc = NULL;
- vd = status->get_viewdata(bl);
- if (!vd || vd->class_ == INVISIBLE_CLASS)
+#endif
+
+ if ( !(vd = status->get_viewdata(bl)) || vd->class_ == INVISIBLE_CLASS )
return; //This performance check is needed to keep GM-hidden objects from being notified to bots.
/**
@@ -1616,21 +1620,27 @@ void clif_move(struct unit_data *ud)
clif->move2(bl, vd, ud);
return;
}
-
- if( (sc = status->get_sc(bl)) && sc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_INVISIBLE|OPTION_CHASEWALK) )
- clif->ally_only = true;
+#ifdef ANTI_MAYAP_CHEAT
+ if( (sc = status->get_sc(bl)) && sc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_INVISIBLE) )
+ clif->ally_only = true;
+#endif
+
WBUFW(buf,0)=0x86;
WBUFL(buf,2)=bl->id;
WBUFPOS2(buf,6,bl->x,bl->y,ud->to_x,ud->to_y,8,8);
WBUFL(buf,12)=(unsigned int)timer->gettick();
+
clif->send(buf, packet_len(0x86), bl, AREA_WOS);
+
if (disguised(bl)) {
WBUFL(buf,2)=-bl->id;
clif->send(buf, packet_len(0x86), bl, SELF);
}
-
+
+#ifdef ANTI_MAYAP_CHEAT
clif->ally_only = false;
+#endif
}