summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-05-14 10:05:49 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-05-14 10:05:49 +0000
commiteda1e14f9d7de0c4123f7d823a774d818fa75148 (patch)
tree52fd30eb75b7c7c3f81a41626ddf9d810fae9f54 /src
parent7a8dc0434b420af441041e2ec2fe32ee614c4555 (diff)
downloadhercules-eda1e14f9d7de0c4123f7d823a774d818fa75148.tar.gz
hercules-eda1e14f9d7de0c4123f7d823a774d818fa75148.tar.bz2
hercules-eda1e14f9d7de0c4123f7d823a774d818fa75148.tar.xz
hercules-eda1e14f9d7de0c4123f7d823a774d818fa75148.zip
* Fixed map-server printing deprecation message, when monster event label was used as transport for special attributes (small/large monsters etc.) in script command 'monster' and related commands (bugreport:1274, since r6592, related r5707).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14814 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/mob.c4
-rw-r--r--src/map/npc.c8
-rw-r--r--src/map/npc.h1
-rw-r--r--src/map/script.c14
4 files changed, 22 insertions, 5 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 892ad269a..73fdaa369 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -179,7 +179,7 @@ int mob_parse_dataset(struct spawn_data *data)
if (data->eventname[0])
{
- if(i <= 2)
+ if(npc_event_isspecial(data->eventname))
{ //Portable monster big/small implementation. [Skotlex]
i = atoi(data->eventname);
if (i) {
@@ -191,7 +191,7 @@ int mob_parse_dataset(struct spawn_data *data)
data->state.ai=1;
data->eventname[0] = '\0'; //Clear event as it is not used.
}
- } else {
+ } else if( i ) {
if (data->eventname[i-1] == '"')
data->eventname[i-1] = '\0'; //Remove trailing quote.
if (data->eventname[0] == '"') //Strip leading quotes
diff --git a/src/map/npc.c b/src/map/npc.c
index 95331ae5b..1ebed0f00 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -345,6 +345,14 @@ int npc_event_doall_id(const char* name, int rid)
}
+/// Checks whether or not the event name is used as transport for
+/// special flags.
+bool npc_event_isspecial(const char* eventname)
+{
+ return (bool)( eventname && ISDIGIT(eventname[0]) && !strstr(eventname, "::") );
+}
+
+
/*==========================================
* 時計イベント実行
*------------------------------------------*/
diff --git a/src/map/npc.h b/src/map/npc.h
index 6f705a09c..6e7c7cbeb 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -134,6 +134,7 @@ int npc_do_ontimer(int npc_id, int option);
int npc_event_do(const char* name);
int npc_event_doall(const char* name);
int npc_event_doall_id(const char* name, int rid);
+bool npc_event_isspecial(const char* eventname);
int npc_timerevent_start(struct npc_data* nd, int rid);
int npc_timerevent_stop(struct npc_data* nd);
diff --git a/src/map/script.c b/src/map/script.c
index 39daede0e..739104f32 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -577,9 +577,17 @@ static void disp_error_message2(const char *mes,const char *pos,int report)
/// Checks event parameter validity
static void check_event(struct script_state *st, const char *evt)
{
- if( evt != NULL && *evt != '\0' && !stristr(evt,"::On") ){
- ShowError("NPC event parameter deprecated! Please use 'NPCNAME::OnEVENT' instead of '%s'.\n",evt);
- script_reportsrc(st);
+ if( evt && evt[0] && !stristr(evt, "::On") )
+ {
+ if( npc_event_isspecial(evt) )
+ {
+ ; // portable small/large monsters or other attributes
+ }
+ else
+ {
+ ShowError("NPC event parameter deprecated! Please use 'NPCNAME::OnEVENT' instead of '%s'.\n", evt);
+ script_reportsrc(st);
+ }
}
}