summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-20 13:24:15 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-20 13:24:15 +0000
commita10e65fdc82e4073909354e760c95080a407d25e (patch)
tree9584accc18962093148329ef6ccb26cf72491171 /src/map/script.c
parentf8b4fc65481df7c8c3d831677763387d7effb863 (diff)
downloadhercules-a10e65fdc82e4073909354e760c95080a407d25e.tar.gz
hercules-a10e65fdc82e4073909354e760c95080a407d25e.tar.bz2
hercules-a10e65fdc82e4073909354e760c95080a407d25e.tar.xz
hercules-a10e65fdc82e4073909354e760c95080a407d25e.zip
Console clean up, dropped quite a few pointless messages and modified others to only be displayed when relevant (e.g. you dont need to know you have only 1 subnetwork)
Improved the debugging of scripts when an amount greater than supported of arguments is used. Follow up r16935 -- commit missed the script.c part of it. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16936 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 3e7db8720..7a2b9bea2 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3352,7 +3352,7 @@ static void script_check_buildin_argtype(struct script_state* st, int func)
}
else if( type == 0 )
{// more arguments than necessary ( should not happen, as it is checked before )
- ShowWarning("Found more arguments than necessary.\n");
+ ShowWarning("Found more arguments than necessary. unexpected arg type %s\n",script_op2name(data->type));
invalid++;
break;
}
@@ -11029,23 +11029,24 @@ BUILDIN_FUNC(agitcheck2)
BUILDIN_FUNC(flagemblem)
{
TBL_NPC* nd;
- int g_id=script_getnum(st,2);
+ int g_id = script_getnum(st,2);
if(g_id < 0) return 0;
nd = (TBL_NPC*)map_id2nd(st->oid);
- if( nd == NULL )
- {
+ if( nd == NULL ) {
ShowError("script:flagemblem: npc %d not found\n", st->oid);
- }
- else if( nd->subtype != SCRIPT )
- {
+ } else if( nd->subtype != SCRIPT ) {
ShowError("script:flagemblem: unexpected subtype %d for npc %d '%s'\n", nd->subtype, st->oid, nd->exname);
- }
- else
- {
+ } else {
+ bool changed = ( nd->u.scr.guild_id != g_id )?true:false;
nd->u.scr.guild_id = g_id;
clif_guild_emblem_area(&nd->bl);
+ /* guild flag caching */
+ if( g_id ) /* adding a id */
+ guild_flag_add(nd);
+ else if( changed ) /* removing a flag */
+ guild_flag_remove(nd);
}
return 0;
}