diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-02 18:24:29 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-02 18:24:29 +0000 |
commit | 42c15ccde5ce27e721243afe43e3784f35c63695 (patch) | |
tree | 371349426458e5807185fd58e148739cb2af4e57 /src/map/clif.c | |
parent | 5459510af1250f4ce2032314cb970f116b84a395 (diff) | |
download | hercules-42c15ccde5ce27e721243afe43e3784f35c63695.tar.gz hercules-42c15ccde5ce27e721243afe43e3784f35c63695.tar.bz2 hercules-42c15ccde5ce27e721243afe43e3784f35c63695.tar.xz hercules-42c15ccde5ce27e721243afe43e3784f35c63695.zip |
- Corrected clif_parse_takeitem to ALWAYS return a NAK packet when it fails
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6943 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index b6a9f38f5..fee72a26c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9125,29 +9125,35 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd) { fitem = (struct flooritem_data*)map_id2bl(map_object_id);
- if (pc_isdead(sd)) {
- clif_clearchar_area(&sd->bl, 1);
- return;
- }
+ do {
+ if (pc_isdead(sd)) {
+ clif_clearchar_area(&sd->bl, 1);
+ break;
+ }
- if (fitem == NULL || fitem->bl.type != BL_ITEM || fitem->bl.m != sd->bl.m)
- return;
-
- if (clif_cant_act(sd))
- return;
+ if (fitem == NULL || fitem->bl.type != BL_ITEM || fitem->bl.m != sd->bl.m)
+ break;
- if(pc_iscloaking(sd) || pc_ischasewalk(sd)) //Disable cloaking/chasewalking characters from looting [Skotlex]
- return;
- if(sd->sc.count && (
- sd->sc.data[SC_TRICKDEAD].timer != -1 || //死んだふり
- sd->sc.data[SC_BLADESTOP].timer != -1 || //白刃取り
- sd->sc.data[SC_NOCHAT].timer!=-1 ) //会話禁止
- ) {
- clif_additem(sd,0,0,6); // send fail packet! [Valaris]
- return;
- }
+ if (clif_cant_act(sd))
+ break;
- pc_takeitem(sd, fitem);
+ //Disable cloaking/chasewalking characters from looting [Skotlex]
+ if(pc_iscloaking(sd) || pc_ischasewalk(sd))
+ break;
+
+ if(sd->sc.count && (
+ sd->sc.data[SC_TRICKDEAD].timer != -1 ||
+ sd->sc.data[SC_BLADESTOP].timer != -1 ||
+ sd->sc.data[SC_NOCHAT].timer!=-1 )
+ )
+ break;
+
+ if (!pc_takeitem(sd, fitem))
+ break;
+ return;
+ } while (0);
+ // Client REQUIRES a fail packet or you can no longer pick items.
+ clif_additem(sd,0,0,6);
}
/*==========================================
|