summaryrefslogtreecommitdiff
path: root/src/emap/script_buildins.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-05 17:57:43 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-05 17:59:28 +0300
commit5c7857eac4512a38cd02843d377430e4a33697af (patch)
tree37c96e42759500946d50b8f7089a3b3f3066784b /src/emap/script_buildins.c
parent53dcb71142e15f1f21cf626220de8039b7be7dd4 (diff)
downloadplugin-5c7857eac4512a38cd02843d377430e4a33697af.tar.gz
plugin-5c7857eac4512a38cd02843d377430e4a33697af.tar.bz2
plugin-5c7857eac4512a38cd02843d377430e4a33697af.tar.xz
plugin-5c7857eac4512a38cd02843d377430e4a33697af.zip
Fix getitem* commands for old clients.
Add force termination command if in getitem* commands wrong data was sent to server.
Diffstat (limited to 'src/emap/script_buildins.c')
-rw-r--r--src/emap/script_buildins.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index c4c1d3a..3c7dbc3 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -329,6 +329,7 @@ BUILDIN(requestItem)
{
// take received text/value and store it in the designated variable
sd->state.menu_or_input = 0;
+ st->state = RUN;
int item = 0;
@@ -349,7 +350,6 @@ BUILDIN(requestItem)
}
script_pushint(st, item);
- st->state = RUN;
}
return true;
}
@@ -379,6 +379,7 @@ BUILDIN(requestItems)
{
// take received text/value and store it in the designated variable
sd->state.menu_or_input = 0;
+ st->state = RUN;
if (!*sd->npc_str)
{
@@ -389,7 +390,6 @@ BUILDIN(requestItems)
}
script_pushstr(st, aStrdup(sd->npc_str));
- st->state = RUN;
}
return true;
}
@@ -405,7 +405,7 @@ BUILDIN(requestItemIndex)
st->state = RERUNLINE;
// send item request
- if (client || client->clientVersion >= 11)
+ if (client && client->clientVersion >= 11)
send_npccommand(sd, st->oid, 11);
else
clif->scriptinputstr(sd, st->oid);
@@ -414,6 +414,7 @@ BUILDIN(requestItemIndex)
{
// take received text/value and store it in the designated variable
sd->state.menu_or_input = 0;
+ st->state = RUN;
int item = -1;
@@ -434,7 +435,6 @@ BUILDIN(requestItemIndex)
}
script_pushint(st, item);
- st->state = RUN;
}
return true;
}
@@ -458,7 +458,7 @@ BUILDIN(requestItemsIndex)
st->state = RERUNLINE;
// send item request with limit count
- if (client || client->clientVersion >= 11)
+ if (client && client->clientVersion >= 11)
send_npccommand2(sd, st->oid, 11, count, 0, 0);
else
clif->scriptinputstr(sd, st->oid);
@@ -467,6 +467,7 @@ BUILDIN(requestItemsIndex)
{
// take received text/value and store it in the designated variable
sd->state.menu_or_input = 0;
+ st->state = RUN;
if (!*sd->npc_str)
{
@@ -477,7 +478,6 @@ BUILDIN(requestItemsIndex)
}
script_pushstr(st, aStrdup(sd->npc_str));
- st->state = RUN;
}
return true;
}
@@ -502,7 +502,7 @@ BUILDIN(requestCraft)
st->state = RERUNLINE;
// send item request with limit count
- if (client || client->clientVersion >= 16)
+ if (client && client->clientVersion >= 16)
send_npccommand2(sd, st->oid, 12, count, 0, 0);
else
clif->scriptinputstr(sd, st->oid);
@@ -511,6 +511,7 @@ BUILDIN(requestCraft)
{
// take received text/value and store it in the designated variable
sd->state.menu_or_input = 0;
+ st->state = RUN;
if (!*sd->npc_str)
{
@@ -521,7 +522,6 @@ BUILDIN(requestCraft)
}
script_pushstr(st, aStrdup(sd->npc_str));
- st->state = RUN;
}
return true;
}