From 1a89ef9c1411199ebdfdf87837613a35b72914f1 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Sat, 14 May 2011 11:04:30 +0000 Subject: * Some NPC event related cleaning. - Made event label deprecation message a warning rather than an error, as the scripts still work regardless of whether '::On' is used or not (since r6592). - Introduced constant EVENT_NAME_LENGTH (51) for all event name struct fields to eliminate size inconsistency across all objects (was 50 and 51). - Fixed event names, that are considered special attributes, were not wiped when the value was 0 (since r5707). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14817 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index 739104f32..bf0b4f652 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -585,7 +585,7 @@ static void check_event(struct script_state *st, const char *evt) } else { - ShowError("NPC event parameter deprecated! Please use 'NPCNAME::OnEVENT' instead of '%s'.\n", evt); + ShowWarning("NPC event parameter deprecated! Please use 'NPCNAME::OnEVENT' instead of '%s'.\n", evt); script_reportsrc(st); } } @@ -8187,8 +8187,8 @@ BUILDIN_FUNC(cmdothernpc) // Added by RoVeRT { const char* npc = script_getstr(st,2); const char* command = script_getstr(st,3); - char event[51]; - snprintf(event, 51, "%s::OnCommand%s", npc, command); + char event[EVENT_NAME_LENGTH]; + snprintf(event, sizeof(event), "%s::OnCommand%s", npc, command); check_event(st, event); npc_event_do(event); return 0; -- cgit v1.2.3-60-g2f50