summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-24 01:09:26 -0300
committershennetsind <ind@henn.et>2013-02-24 01:09:26 -0300
commitd4582e286fa64f469112ff76ecae672ce7c57aa5 (patch)
tree77f0920fab02857f4cdfe02ffdc402d4638419ec
parentadda8d74c3280ae1e3745591caafd9ce6e81ded7 (diff)
downloadhercules-d4582e286fa64f469112ff76ecae672ce7c57aa5.tar.gz
hercules-d4582e286fa64f469112ff76ecae672ce7c57aa5.tar.bz2
hercules-d4582e286fa64f469112ff76ecae672ce7c57aa5.tar.xz
hercules-d4582e286fa64f469112ff76ecae672ce7c57aa5.zip
Revert "Fixed Bug #7091"
This reverts commit adda8d74c3280ae1e3745591caafd9ce6e81ded7. Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r--src/map/clif.c25
-rw-r--r--src/map/npc.c5
-rw-r--r--src/map/npc.h2
-rw-r--r--src/map/pc.c8
-rw-r--r--src/map/script.c2
5 files changed, 15 insertions, 27 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index dcbeae3c4..b7117a64a 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9520,7 +9520,7 @@ void clif_parse_progressbar(int fd, struct map_session_data * sd)
sd->st->state = END;
sd->progressbar.npc_id = sd->progressbar.timeout = 0;
- npc_scriptcont(sd, npc_id, false);
+ npc_scriptcont(sd, npc_id);
}
@@ -10179,7 +10179,12 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd)
return;
}
- if ( (!sd->npc_id && pc_istrading(sd)) || sd->chatID )
+ //This flag enables you to use items while in an NPC. [Skotlex]
+ if (sd->npc_id) {
+ if (sd->npc_id != sd->npc_item_flag)
+ return;
+ }
+ else if ( pc_istrading(sd) || sd->chatID )
return;
//Whether the item is used or not is irrelevant, the char ain't idle. [Skotlex]
@@ -10790,12 +10795,6 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
// Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex]
sd->idletime = last_tick;
- if( sd->npc_id ){
-#ifdef RENEWAL
- clif_msg(sd, 0x783); // TODO look for the client date that has this message.
-#endif
- return;
- }
if( pc_cant_act(sd) && skill_id != RK_REFRESH && !(skill_id == SR_GENTLETOUCH_CURE && (sd->sc.opt1 == OPT1_STONE || sd->sc.opt1 == OPT1_FREEZE || sd->sc.opt1 == OPT1_STUN)) )
return;
if( pc_issit(sd) )
@@ -11130,7 +11129,7 @@ void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd)
}
sd->npc_menu = select;
- npc_scriptcont(sd,npc_id, false);
+ npc_scriptcont(sd,npc_id);
}
@@ -11138,7 +11137,7 @@ void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd)
/// 00b9 <npc id>.L
void clif_parse_NpcNextClicked(int fd,struct map_session_data *sd)
{
- npc_scriptcont(sd,RFIFOL(fd,2), false);
+ npc_scriptcont(sd,RFIFOL(fd,2));
}
@@ -11150,7 +11149,7 @@ void clif_parse_NpcAmountInput(int fd,struct map_session_data *sd)
int amount = (int)RFIFOL(fd,6);
sd->npc_amount = amount;
- npc_scriptcont(sd, npcid, false);
+ npc_scriptcont(sd, npcid);
}
@@ -11166,7 +11165,7 @@ void clif_parse_NpcStringInput(int fd, struct map_session_data* sd)
return; // invalid input
safestrncpy(sd->npc_str, message, min(message_len,CHATBOX_SIZE));
- npc_scriptcont(sd, npcid, false);
+ npc_scriptcont(sd, npcid);
}
@@ -11176,7 +11175,7 @@ void clif_parse_NpcCloseClicked(int fd,struct map_session_data *sd)
{
if (!sd->npc_id) //Avoid parsing anything when the script was done with. [Skotlex]
return;
- npc_scriptcont(sd, RFIFOL(fd,2), true);
+ npc_scriptcont(sd,RFIFOL(fd,2));
}
diff --git a/src/map/npc.c b/src/map/npc.c
index abe916b4f..f72f6532c 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1194,7 +1194,7 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd)
/*==========================================
*
*------------------------------------------*/
-int npc_scriptcont(struct map_session_data* sd, int id, bool closing)
+int npc_scriptcont(struct map_session_data* sd, int id)
{
nullpo_retr(1, sd);
@@ -1229,9 +1229,6 @@ int npc_scriptcont(struct map_session_data* sd, int id, bool closing)
if( sd->progressbar.npc_id && DIFF_TICK(sd->progressbar.timeout,gettick()) > 0 )
return 1;
- if( closing )
- sd->st->state = END;
-
run_script_main(sd->st);
return 0;
diff --git a/src/map/npc.h b/src/map/npc.h
index 7b69cac34..ee88da08c 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -118,7 +118,7 @@ int npc_touch_areanpc2(struct mob_data *md); // [Skotlex]
int npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range);
int npc_touchnext_areanpc(struct map_session_data* sd,bool leavemap);
int npc_click(struct map_session_data* sd, struct npc_data* nd);
-int npc_scriptcont(struct map_session_data* sd, int id, bool closing);
+int npc_scriptcont(struct map_session_data* sd, int id);
struct npc_data* npc_checknear(struct map_session_data* sd, struct block_list* bl);
int npc_buysellsel(struct map_session_data* sd, int id, int type);
int npc_buylist(struct map_session_data* sd,int n, unsigned short* item_list);
diff --git a/src/map/pc.c b/src/map/pc.c
index 7eae16193..6078283e7 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4232,14 +4232,6 @@ int pc_useitem(struct map_session_data *sd,int n)
nullpo_ret(sd);
- //This flag enables you to use items while in an NPC. [Skotlex]
- if( sd->npc_id && sd->npc_id != sd->npc_item_flag ){
-#ifdef RENEWAL
- clif_msg(sd, 0x783); // TODO look for the client date that has this message.
-#endif
- return 0;
- }
-
if( sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount <= 0 )
return 0;
diff --git a/src/map/script.c b/src/map/script.c
index ddffe4425..8827509ba 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -4392,7 +4392,7 @@ BUILDIN_FUNC(close)
if( sd == NULL )
return 0;
- st->state = STOP;
+ st->state = END;
clif_scriptclose(sd, st->oid);
return 0;
}