summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-04-27 13:08:14 +0200
committerGitHub <noreply@github.com>2017-04-27 13:08:14 +0200
commit109661e3d5fb4cc6ddde9b32f8c99012c8d17bce (patch)
tree86754bed4c6b343469face07d8f2c0c5dea072a9 /src
parent436632b600f651f8f9d33c5bb64beaf9adcc38e4 (diff)
parent149f199fdd0483dfa3df89bed0fe49d95da59b27 (diff)
downloadhercules-109661e3d5fb4cc6ddde9b32f8c99012c8d17bce.tar.gz
hercules-109661e3d5fb4cc6ddde9b32f8c99012c8d17bce.tar.bz2
hercules-109661e3d5fb4cc6ddde9b32f8c99012c8d17bce.tar.xz
hercules-109661e3d5fb4cc6ddde9b32f8c99012c8d17bce.zip
Merge pull request #1711 from mekolat/checkoption2
allow checkoption et al to check another player
Diffstat (limited to 'src')
-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 d1806cb41..fb9f2aa02 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9957,7 +9957,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
@@ -9976,7 +9982,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
@@ -9995,7 +10007,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
@@ -10019,7 +10037,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
@@ -23205,8 +23229,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,"?"),
@@ -23356,8 +23380,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]