* 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://svn.code.sf.net/p/rathena/svn/trunk@14814 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
9d505aed9b
commit
333c944cae
@ -1,5 +1,7 @@
|
|||||||
Date Added
|
Date Added
|
||||||
|
|
||||||
|
2011/05/14
|
||||||
|
* 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). [Ai4rei]
|
||||||
2011/05/13
|
2011/05/13
|
||||||
* Random accumulated bits and pieces. [Ai4rei]
|
* Random accumulated bits and pieces. [Ai4rei]
|
||||||
- Added checks/warnings to pc_paycash and pc_getcash (follow up to r12264).
|
- Added checks/warnings to pc_paycash and pc_getcash (follow up to r12264).
|
||||||
|
@ -179,7 +179,7 @@ int mob_parse_dataset(struct spawn_data *data)
|
|||||||
|
|
||||||
if (data->eventname[0])
|
if (data->eventname[0])
|
||||||
{
|
{
|
||||||
if(i <= 2)
|
if(npc_event_isspecial(data->eventname))
|
||||||
{ //Portable monster big/small implementation. [Skotlex]
|
{ //Portable monster big/small implementation. [Skotlex]
|
||||||
i = atoi(data->eventname);
|
i = atoi(data->eventname);
|
||||||
if (i) {
|
if (i) {
|
||||||
@ -191,7 +191,7 @@ int mob_parse_dataset(struct spawn_data *data)
|
|||||||
data->state.ai=1;
|
data->state.ai=1;
|
||||||
data->eventname[0] = '\0'; //Clear event as it is not used.
|
data->eventname[0] = '\0'; //Clear event as it is not used.
|
||||||
}
|
}
|
||||||
} else {
|
} else if( i ) {
|
||||||
if (data->eventname[i-1] == '"')
|
if (data->eventname[i-1] == '"')
|
||||||
data->eventname[i-1] = '\0'; //Remove trailing quote.
|
data->eventname[i-1] = '\0'; //Remove trailing quote.
|
||||||
if (data->eventname[0] == '"') //Strip leading quotes
|
if (data->eventname[0] == '"') //Strip leading quotes
|
||||||
|
@ -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, "::") );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 時計イベント実行
|
* 時計イベント実行
|
||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
|
@ -134,6 +134,7 @@ int npc_do_ontimer(int npc_id, int option);
|
|||||||
int npc_event_do(const char* name);
|
int npc_event_do(const char* name);
|
||||||
int npc_event_doall(const char* name);
|
int npc_event_doall(const char* name);
|
||||||
int npc_event_doall_id(const char* name, int rid);
|
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_start(struct npc_data* nd, int rid);
|
||||||
int npc_timerevent_stop(struct npc_data* nd);
|
int npc_timerevent_stop(struct npc_data* nd);
|
||||||
|
@ -577,10 +577,18 @@ static void disp_error_message2(const char *mes,const char *pos,int report)
|
|||||||
/// Checks event parameter validity
|
/// Checks event parameter validity
|
||||||
static void check_event(struct script_state *st, const char *evt)
|
static void check_event(struct script_state *st, const char *evt)
|
||||||
{
|
{
|
||||||
if( evt != NULL && *evt != '\0' && !stristr(evt,"::On") ){
|
if( evt && evt[0] && !stristr(evt, "::On") )
|
||||||
ShowError("NPC event parameter deprecated! Please use 'NPCNAME::OnEVENT' instead of '%s'.\n",evt);
|
{
|
||||||
|
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);
|
script_reportsrc(st);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user