From 882a3192acdd6ca2a6e50fc0f9fc877bc454efb7 Mon Sep 17 00:00:00 2001 From: ultramage Date: Wed, 12 Mar 2008 21:02:59 +0000 Subject: Removed one mob data variable related to dynamic mobs that I found to be redundant. Changed MAX_MOBSKILL (max. amount of different skill entries per mob) from 50 to 40 to reduce memory consumption a bit more. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12350 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/npc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/map/npc.c') diff --git a/src/map/npc.c b/src/map/npc.c index fa4f510d6..86b3c260a 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2178,11 +2178,9 @@ static const char* npc_parse_function(char* w1, char* w2, char* w3, char* w4, co * Parse Mob 1 - Parse mob list into each map * Parse Mob 2 - Actually Spawns Mob * [Wizputer] - * If cached =1, it is a dynamic cached mob - * index points to the index in the mob_list of the map_data cache. - * -1 indicates that it is not stored on the map. + * If 'cached' is true, it is a dynamic cached mob *------------------------------------------*/ -int npc_parse_mob2(struct spawn_data* mob, int index) +int npc_parse_mob2(struct spawn_data* mob, bool cached) { int i; struct mob_data *md; @@ -2190,8 +2188,7 @@ int npc_parse_mob2(struct spawn_data* mob, int index) for (i = mob->skip; i < mob->num; i++) { md = mob_spawn_dataset(mob); md->spawn = mob; - md->spawn_n = index; - md->special_state.cached = (index>=0); //If mob is cached on map, it is dynamically removed + md->special_state.cached = cached; //If mob is cached on map, it is dynamically removed mob_spawn(md); } mob->skip = 0; @@ -2340,7 +2337,7 @@ static const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const c memcpy(data, &mob, sizeof(struct spawn_data)); if( !battle_config.dynamic_mobs || mob.delay1 || mob.delay2 ) { - npc_parse_mob2(data,-1); + npc_parse_mob2(data,false); npc_delay_mob += mob.num; } else { int index = map_addmobtolist(data->m, data); @@ -2349,14 +2346,14 @@ static const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const c // (usually shouldn't occur when map server is just starting, // but not the case when we do @reloadscript if (map[mob.m].users > 0) - npc_parse_mob2(data,index); + npc_parse_mob2(data,true); npc_cache_mob += mob.num; } else { // mobcache is full // create them as delayed with one second mob.delay1 = 1000; mob.delay2 = 1000; - npc_parse_mob2(data,-1); + npc_parse_mob2(data,false); npc_delay_mob += mob.num; } } -- cgit v1.2.3-70-g09d2