From 416cc5c5acdb51aaeda31bb32e0952b5f5bac554 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 4 May 2013 13:32:06 -0300 Subject: Enabling a temporary debug setup for mapindex so when this thing finds a unknown id we can actually know where it came from. Signed-off-by: shennetsind --- src/common/mapindex.c | 5 ++--- src/common/mapindex.h | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/mapindex.c b/src/common/mapindex.c index edf9f26f8..6af5f134f 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -133,10 +133,9 @@ unsigned short mapindex_name2id(const char* name) return 0; } -const char* mapindex_id2name(unsigned short id) -{ +const char* mapindex_id2name_sub(unsigned short id,const char *file, int line, const char *func) { if (id > MAX_MAPINDEX || !mapindex_exists(id)) { - ShowDebug("mapindex_id2name: Requested name for non-existant map index [%d] in cache.\n", id); + ShowDebug("mapindex_id2name: Requested name for non-existant map index [%d] in cache. %s:%s:%d\n", id,file,func,line); return indexes[0].name; // dummy empty string so that the callee doesn't crash } return indexes[id].name; diff --git a/src/common/mapindex.h b/src/common/mapindex.h index 75cb254c0..4c0641c56 100644 --- a/src/common/mapindex.h +++ b/src/common/mapindex.h @@ -50,7 +50,8 @@ extern char mapindex_cfgfile[80]; const char* mapindex_getmapname(const char* string, char* output); const char* mapindex_getmapname_ext(const char* string, char* output); unsigned short mapindex_name2id(const char*); -const char* mapindex_id2name(unsigned short); +#define mapindex_id2name(n) mapindex_id2name_sub(n,__FILE__, __LINE__, __func__) +const char* mapindex_id2name_sub(unsigned short,const char *file, int line, const char *func); void mapindex_init(void); void mapindex_final(void); -- cgit v1.2.3-60-g2f50