diff options
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 778fc1dfa..b8a8ed6c5 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -601,7 +601,7 @@ int mob_spawn_guardian_sub(int tid, int64 tick, int id, intptr_t data) { memcpy(md->guardian_data->guild_name, g->name, NAME_LENGTH); md->guardian_data->guardup_lv = guardup_lv; if( guardup_lv ) - status_calc_mob(md, 0); //Give bonuses. + status_calc_mob(md, SCO_NONE); //Give bonuses. return 0; } @@ -919,7 +919,7 @@ int mob_spawn (struct mob_data *md) } memset(&md->state, 0, sizeof(md->state)); - status_calc_mob(md, 1); + status_calc_mob(md, SCO_FIRST); md->attacked_id = 0; md->target_id = 0; md->move_fail_count = 0; @@ -2731,7 +2731,7 @@ int mob_class_change (struct mob_data *md, int class_) unit->skillcastcancel(&md->bl, 0); status->set_viewdata(&md->bl, class_); clif->class_change(&md->bl, md->vd->class_, 1); - status_calc_mob(md, 1); + status_calc_mob(md, SCO_FIRST); md->ud.state.speed_changed = 1; //Speed change update. if (battle_config.monster_class_change_recover) { @@ -4540,7 +4540,12 @@ bool mob_readdb_itemratio(char* str[], int columns, int current) /** * read all mob-related databases */ -void mob_load(void) { +void mob_load(bool minimal) { + if (minimal) { + // Only read the mob db in minimal mode + mob->readdb(); + return; + } sv->readdb(map->db_path, "mob_item_ratio.txt", ',', 2, 2+MAX_ITEMRATIO_MOBS, -1, mob->readdb_itemratio); // must be read before mobdb mob->readchatdb(); if (map->db_use_sql_mob_db) { @@ -4575,7 +4580,7 @@ void mob_reload(void) { } } - mob->load(); + mob->load(false); } void mob_clear_spawninfo() @@ -4589,15 +4594,18 @@ void mob_clear_spawninfo() /*========================================== * Circumference initialization of mob *------------------------------------------*/ -int do_init_mob(void) -{ //Initialize the mob database +int do_init_mob(bool minimal) { + // Initialize the mob database memset(mob->db_data,0,sizeof(mob->db_data)); //Clear the array - mob->db_data[0] = (struct mob_db*)aCalloc(1, sizeof (struct mob_db)); //This mob is used for random spawns + mob->db_data[0] = (struct mob_db*)aCalloc(1, sizeof (struct mob_db)); //This mob is used for random spawns mob->makedummymobdb(0); //The first time this is invoked, it creates the dummy mob item_drop_ers = ers_new(sizeof(struct item_drop),"mob.c::item_drop_ers",ERS_OPT_NONE); item_drop_list_ers = ers_new(sizeof(struct item_drop_list),"mob.c::item_drop_list_ers",ERS_OPT_NONE); - mob->load(); + mob->load(minimal); + + if (minimal) + return 0; timer->add_func_list(mob->delayspawn,"mob_delayspawn"); timer->add_func_list(mob->delay_item_drop,"mob_delay_item_drop"); |