diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/console.c | 2 | ||||
-rw-r--r-- | src/common/malloc.c | 2 | ||||
-rw-r--r-- | src/common/mapindex.c | 17 | ||||
-rw-r--r-- | src/common/mapindex.h | 7 | ||||
-rw-r--r-- | src/common/mmo.h | 8 |
5 files changed, 33 insertions, 3 deletions
diff --git a/src/common/console.c b/src/common/console.c index 577d1a3f0..6c5a5c886 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -112,7 +112,9 @@ CPCMD_C(ers_report,server) { * Displays memory usage **/ CPCMD_C(mem_report,server) { +#ifdef USE_MEMMGR memmgr_report(line?atoi(line):0); +#endif } /** diff --git a/src/common/malloc.c b/src/common/malloc.c index 625875b76..244b1114c 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -822,8 +822,10 @@ void malloc_final (void) { } void malloc_init (void) { +#ifdef USE_MEMMGR memmgr_usage_bytes_t = 0; memmgr_usage_bytes = 0; +#endif #if defined(DMALLOC) && defined(CYGWIN) // http://dmalloc.com/docs/latest/online/dmalloc_19.html dmalloc_debug_setup(getenv("DMALLOC_OPTIONS")); diff --git a/src/common/mapindex.c b/src/common/mapindex.c index ec829ee56..0d8a69726 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -165,13 +165,20 @@ int mapindex_init(void) { } fclose(fp); - if( !strdb_iget(mapindex->db, MAP_DEFAULT) ) { - ShowError("mapindex_init: MAP_DEFAULT '%s' not found in cache! update mapindex.h MAP_DEFAULT var!!!\n",MAP_DEFAULT); - } + mapindex->check_default(); return total; } +bool mapindex_check_default(void) +{ + if (!strdb_iget(mapindex->db, mapindex->default_map)) { + ShowError("mapindex_init: MAP_DEFAULT '%s' not found in cache! update mapindex.h MAP_DEFAULT var!!!\n", mapindex->default_map); + return false; + } + return true; +} + void mapindex_removemap(int index){ strdb_remove(mapindex->db, mapindex->list[index].name); mapindex->list[index].name[0] = '\0'; @@ -189,6 +196,9 @@ void mapindex_defaults(void) { /* */ mapindex->db = NULL; mapindex->num = 0; + mapindex->default_map = MAP_DEFAULT; + mapindex->default_x = MAP_DEFAULT_X; + mapindex->default_y = MAP_DEFAULT_Y; memset (&mapindex->list, 0, sizeof (mapindex->list)); /* */ @@ -201,4 +211,5 @@ void mapindex_defaults(void) { mapindex->getmapname_ext = mapindex_getmapname_ext; mapindex->name2id = mapindex_name2id; mapindex->id2name = mapindex_id2name_sub; + mapindex->check_default = mapindex_check_default; } diff --git a/src/common/mapindex.h b/src/common/mapindex.h index 446a2422d..91bf4562e 100644 --- a/src/common/mapindex.h +++ b/src/common/mapindex.h @@ -67,6 +67,12 @@ struct mapindex_interface { DBMap *db; /* number of entries in the index table */ int num; + /* default map name */ + char *default_map; + /* default x on map */ + int default_x; + /* default y on map */ + int default_y; /* index list -- since map server map count is *unlimited* this should be too */ struct { char name[MAP_NAME_LENGTH]; @@ -84,6 +90,7 @@ struct mapindex_interface { /* TODO: Hello World! make up your mind, this thing is int on some places and unsigned short on others */ unsigned short (*name2id) (const char*); const char* (*id2name) (unsigned short,const char *file, int line, const char *func); + bool (*check_default) (void); }; struct mapindex_interface *mapindex; diff --git a/src/common/mmo.h b/src/common/mmo.h index fd054ba91..ef42e49c0 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -376,6 +376,14 @@ struct s_homunculus { //[orn] int int_; int dex; int luk; + + int str_value; + int agi_value; + int vit_value; + int int_value; + int dex_value; + int luk_value; + int8 spiritball; //for homun S [lighta] }; |