summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-04-24 11:01:12 -0400
committergumi <mekolat@users.noreply.github.com>2017-04-27 16:39:39 -0400
commit57cd63c435601418754c21631201ea6ef447f422 (patch)
tree1efc0c7f271c1a2c2b221e77ca55f25331563eef
parentfb6d3f9cdec0f157b651bd561e0fac810001effd (diff)
downloadhercules-57cd63c435601418754c21631201ea6ef447f422.tar.gz
hercules-57cd63c435601418754c21631201ea6ef447f422.tar.bz2
hercules-57cd63c435601418754c21631201ea6ef447f422.tar.xz
hercules-57cd63c435601418754c21631201ea6ef447f422.zip
allow checkoption et al to check another player
-rw-r--r--src/map/script.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/src/map/script.c b/src/map/script.c
index a6d3ac852..16f61186a 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9950,7 +9950,13 @@ BUILDIN(end) {
BUILDIN(checkoption)
{
int option;
- struct map_session_data *sd = script->rid2sd(st);
+ struct map_session_data *sd;
+
+ if (script_hasdata(st, 3))
+ sd = map->id2sd(script_getnum(st, 3));
+ else
+ sd = script->rid2sd(st);
+
if (sd == NULL)
return true;// no player attached, report source
@@ -9969,7 +9975,13 @@ BUILDIN(checkoption)
BUILDIN(checkoption1)
{
int opt1;
- struct map_session_data *sd = script->rid2sd(st);
+ struct map_session_data *sd;
+
+ if (script_hasdata(st, 3))
+ sd = map->id2sd(script_getnum(st, 3));
+ else
+ sd = script->rid2sd(st);
+
if (sd == NULL)
return true;// no player attached, report source
@@ -9988,7 +10000,13 @@ BUILDIN(checkoption1)
BUILDIN(checkoption2)
{
int opt2;
- struct map_session_data *sd = script->rid2sd(st);
+ struct map_session_data *sd;
+
+ if (script_hasdata(st, 3))
+ sd = map->id2sd(script_getnum(st, 3));
+ else
+ sd = script->rid2sd(st);
+
if (sd == NULL)
return true;// no player attached, report source
@@ -10012,7 +10030,13 @@ BUILDIN(setoption)
{
int option;
int flag = 1;
- struct map_session_data *sd = script->rid2sd(st);
+ struct map_session_data *sd;
+
+ if (script_hasdata(st, 4))
+ sd = map->id2sd(script_getnum(st, 4));
+ else
+ sd = script->rid2sd(st);
+
if (sd == NULL)
return true;// no player attached, report source
@@ -23198,8 +23222,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(setgroupid, "i?"),
BUILDIN_DEF(getgroupid,""),
BUILDIN_DEF(end,""),
- BUILDIN_DEF(checkoption,"i"),
- BUILDIN_DEF(setoption,"i?"),
+ BUILDIN_DEF(checkoption,"i?"),
+ BUILDIN_DEF(setoption,"i??"),
BUILDIN_DEF(setcart,"?"),
BUILDIN_DEF(checkcart,""),
BUILDIN_DEF(setfalcon,"?"),
@@ -23349,8 +23373,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(setnpcdir,"*"), // [4144]
BUILDIN_DEF(getnpcclass,"?"), // [4144]
BUILDIN_DEF(getmapxy,"rrri?"), //by Lorky [Lupus]
- BUILDIN_DEF(checkoption1,"i"),
- BUILDIN_DEF(checkoption2,"i"),
+ BUILDIN_DEF(checkoption1,"i?"),
+ BUILDIN_DEF(checkoption2,"i?"),
BUILDIN_DEF(guildgetexp,"i"),
BUILDIN_DEF(guildchangegm,"is"),
BUILDIN_DEF(logmes,"s"), //this command actls as MES but rints info into LOG file either SQL/TXT [Lupus]