summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-15 19:58:38 +0100
committerHaru <haru@dotalux.com>2015-12-15 20:21:28 +0100
commitc3aeb496b7016ce85f55da938d1939fa330d1c60 (patch)
treecf8adf4b480b32d60257c59f4b4ca053385e95f5 /src/map/npc.c
parent0c4b3b1c57a8e75f1b13456fb60de3a69e680f45 (diff)
downloadhercules-c3aeb496b7016ce85f55da938d1939fa330d1c60.tar.gz
hercules-c3aeb496b7016ce85f55da938d1939fa330d1c60.tar.bz2
hercules-c3aeb496b7016ce85f55da938d1939fa330d1c60.tar.xz
hercules-c3aeb496b7016ce85f55da938d1939fa330d1c60.zip
Added const qualifier to the w1~w4 arguments of npc_parse_script
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 1912235b8..0dad88212 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2922,12 +2922,38 @@ const char* npc_skip_script(const char* start, const char* buffer, const char* f
return p+1;// return after the last '}'
}
-/// Parses a npc script.
-///
-/// -%TAB%script%TAB%<NPC Name>%TAB%-1,{<code>}
-/// <map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite id>,{<code>}
-/// <map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>,{<code>}
-const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath, int options, int *retval)
+/**
+ * Parses a NPC script.
+ *
+ * Example:
+ * @code
+ * -<TAB>script<TAB><NPC Name><TAB>-1,{
+ * <code>
+ * }
+ * <map name>,<x>,<y>,<facing><TAB>script<TAB><NPC Name><TAB><sprite id>,{
+ * <code>
+ * }
+ * <map name>,<x>,<y>,<facing><TAB>script<TAB><NPC Name><TAB><sprite id>,<triggerX>,<triggerY>,{
+ * <code>
+ * }
+ * @endcode
+ *
+ * @param[in] w1 First tab-delimited part of the string to parse.
+ * @param[in] w2 Second tab-delimited part of the string to parse.
+ * @param[in] w3 Third tab-delimited part of the string to parse.
+ * @param[in] w4 Fourth tab-delimited part of the string to parse.
+ * @param[in] start Pointer to the beginning of the string inside buffer.
+ * This must point to the same buffer as `buffer`.
+ * @param[in] buffer Pointer to the buffer containing the script. For
+ * single-line mapflags not inside a script, this may be
+ * an empty (but initialized) single-character buffer.
+ * @param[in] filepath Source file path.
+ * @param[in] options NPC parse/load options (@see enum npc_parse_options).
+ * @param[out] retval Pointer to return the success (EXIT_SUCCESS) or failure
+ * (EXIT_FAILURE) status. May be NULL.
+ * @return A pointer to the advanced buffer position.
+ */
+const char *npc_parse_script(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval)
{
int x, y, dir = 0, m, xs = 0, ys = 0; // [Valaris] thanks to fov
struct script_code *scriptroot;