diff options
author | Haru <haru@dotalux.com> | 2020-04-05 23:41:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-05 23:41:17 +0200 |
commit | a77dc973845efc6e45c5eea9513f6a161893c201 (patch) | |
tree | 47ac11b91dd4343a3d429b3651dc3c0202a546f3 /src/map/script.c | |
parent | 413b7bbe5905bdd4ae790b8dce3ef869433e2b25 (diff) | |
parent | 588a8997817621f1bc65c9ccb999d5cda3e3fb4d (diff) | |
download | hercules-a77dc973845efc6e45c5eea9513f6a161893c201.tar.gz hercules-a77dc973845efc6e45c5eea9513f6a161893c201.tar.bz2 hercules-a77dc973845efc6e45c5eea9513f6a161893c201.tar.xz hercules-a77dc973845efc6e45c5eea9513f6a161893c201.zip |
Merge pull request #2668 from Kenpachi2k13/extend_pcblock_commands
Extend *pcblock script commands
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/map/script.c b/src/map/script.c index ca13e8861..3d5534a47 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -19263,12 +19263,14 @@ static BUILDIN(pcblockmove) static BUILDIN(setpcblock) { - struct map_session_data *sd = script->rid2sd(st); + struct map_session_data *sd = script_hasdata(st, 4) ? script->id2sd(st, script_getnum(st, 4)) : script->rid2sd(st); enum pcblock_action_flag type = script_getnum(st, 2); int state = (script_getnum(st, 3) > 0) ? 1 : 0; - if (sd == NULL) + if (sd == NULL) { + script_pushint(st, 0); return true; + } if ((type & PCBLOCK_MOVE) != 0) sd->block_action.move = state; @@ -19297,12 +19299,13 @@ static BUILDIN(setpcblock) if ((type & PCBLOCK_NPC) != 0) sd->block_action.npc = state; + script_pushint(st, 1); return true; } static BUILDIN(checkpcblock) { - struct map_session_data *sd = script->rid2sd(st); + struct map_session_data *sd = script_hasdata(st, 2) ? script->id2sd(st, script_getnum(st, 2)) : script->rid2sd(st); int retval = PCBLOCK_NONE; if (sd == NULL) { @@ -27146,8 +27149,8 @@ static void script_parse_builtin(void) BUILDIN_DEF(pcfollow,"ii"), BUILDIN_DEF(pcstopfollow,"i"), BUILDIN_DEF_DEPRECATED(pcblockmove,"ii"), // Deprecated 2018-05-04 - BUILDIN_DEF(setpcblock, "ii"), - BUILDIN_DEF(checkpcblock, ""), + BUILDIN_DEF(setpcblock, "ii?"), + BUILDIN_DEF(checkpcblock, "?"), // <--- [zBuffer] List of player cont commands // [zBuffer] List of mob control commands ---> BUILDIN_DEF(getunittype,"i"), |