Added NPC path to debug output (#6198)
Have you ever been annoyed by a script error that did not tell you in which file the NPC is located? This will fix it for you.
This commit is contained in:
parent
135705069a
commit
ff2c4e2b00
@ -496,12 +496,15 @@ static void script_reportsrc(struct script_state *st)
|
||||
return;
|
||||
|
||||
switch( bl->type ) {
|
||||
case BL_NPC:
|
||||
case BL_NPC: {
|
||||
struct npc_data* nd = (struct npc_data*)bl;
|
||||
|
||||
if( bl->m >= 0 )
|
||||
ShowDebug("Source (NPC): %s at %s (%d,%d)\n", ((struct npc_data *)bl)->name, map_mapid2mapname(bl->m), bl->x, bl->y);
|
||||
ShowDebug("Source (NPC): %s at %s (%d,%d)\n", nd->name, map_mapid2mapname(bl->m), bl->x, bl->y);
|
||||
else
|
||||
ShowDebug("Source (NPC): %s (invisible/not on a map)\n", ((struct npc_data *)bl)->name);
|
||||
break;
|
||||
ShowDebug("Source (NPC): %s (invisible/not on a map)\n", nd->name);
|
||||
ShowDebug( "Source (NPC): %s is located in: %s\n", nd->name, nd->path );
|
||||
} break;
|
||||
default:
|
||||
if( bl->m >= 0 )
|
||||
ShowDebug("Source (Non-NPC type %d): name %s at %s (%d,%d)\n", bl->type, status_get_name(bl), map_mapid2mapname(bl->m), bl->x, bl->y);
|
||||
|
Loading…
x
Reference in New Issue
Block a user