diff options
Diffstat (limited to 'src/map/map.c')
-rw-r--r-- | src/map/map.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/map/map.c b/src/map/map.c index e901eb6b9..16d5e645d 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -337,6 +337,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, int64 tick) { //status_change_end(bl, SC_BLADESTOP, INVALID_TIMER); //Won't stop when you are knocked away, go figure... status_change_end(bl, SC_NJ_TATAMIGAESHI, INVALID_TIMER); status_change_end(bl, SC_MAGICROD, INVALID_TIMER); + status_change_end(bl, SC_SU_STOOP, INVALID_TIMER); if (sc && sc->data[SC_PROPERTYWALK] && sc->data[SC_PROPERTYWALK]->val3 >= skill->get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) ) status_change_end(bl,SC_PROPERTYWALK,INVALID_TIMER); @@ -1929,6 +1930,7 @@ int map_quit(struct map_session_data *sd) { case SC_GDSKILL_REGENERATION: if( !sd->sc.data[i]->val4 ) break; + FALLTHROUGH default: status_change_end(&sd->bl, (sc_type)i, INVALID_TIMER); } @@ -3738,8 +3740,8 @@ int map_readallmaps (void) { if( map->enable_grf ) ShowStatus("Loading maps (using GRF files)...\n"); else { - char mapcachefilepath[254]; - sprintf(mapcachefilepath,"%s/%s%s",map->db_path,DBPATH,"map_cache.dat"); + char mapcachefilepath[256]; + snprintf(mapcachefilepath, 256, "%s/%s%s", map->db_path, DBPATH, "map_cache.dat"); ShowStatus("Loading maps (using %s as map cache)...\n", mapcachefilepath); if( (fp = fopen(mapcachefilepath, "rb")) == NULL ) { ShowFatalError("Unable to open map cache file "CL_WHITE"%s"CL_RESET"\n", mapcachefilepath); @@ -3996,7 +3998,7 @@ bool map_config_read_map_list(const char *filename, struct config_t *config, boo nullpo_retr(false, filename); nullpo_retr(false, config); - deleted_maps = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY, MAP_NAME_LENGTH); + deleted_maps = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_ALLOW_NULL_DATA, MAP_NAME_LENGTH); // Remove maps if ((setting = libconfig->lookup(config, "map_configuration/map_removed")) != NULL) { @@ -4128,6 +4130,7 @@ bool map_read_npclist(const char *filename, bool imported) struct config_setting_t *setting = NULL; const char *import = NULL; bool retval = true; + bool remove_all = false; struct DBMap *deleted_npcs; @@ -4136,9 +4139,9 @@ bool map_read_npclist(const char *filename, bool imported) if (!libconfig->load_file(&config, filename)) return false; - deleted_npcs = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY, MAP_NAME_LENGTH); + deleted_npcs = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_ALLOW_NULL_DATA, 0); - // Remove maps + // Remove NPCs if ((setting = libconfig->lookup(&config, "npc_removed_list")) != NULL) { int i, del_count = libconfig->setting_length(setting); for (i = 0; i < del_count; i++) { @@ -4147,10 +4150,13 @@ bool map_read_npclist(const char *filename, bool imported) if ((scriptname = libconfig->setting_get_string_elem(setting, i)) == NULL || scriptname[0] == '\0') continue; - strdb_put(deleted_npcs, scriptname, NULL); - - if (imported) // Map list is empty on the first run, only do this for imported files. + if (strcmp(scriptname, "all") == 0) { + remove_all = true; + npc->clearsrcfile(); + } else { + strdb_put(deleted_npcs, scriptname, NULL); npc->delsrcfile(scriptname); + } } } @@ -4168,7 +4174,7 @@ bool map_read_npclist(const char *filename, bool imported) if ((scriptname = libconfig->setting_get_string_elem(setting, i)) == NULL || scriptname[0] == '\0') continue; - if (strdb_exists(deleted_npcs, scriptname)) + if (remove_all || strdb_exists(deleted_npcs, scriptname)) continue; npc->addsrcfile(scriptname); @@ -4208,7 +4214,7 @@ bool map_read_npclist(const char *filename, bool imported) void map_reloadnpc(bool clear) { int i; if (clear) - npc->addsrcfile("clear"); // this will clear the current script list + npc->clearsrcfile(); #ifdef RENEWAL map->read_npclist("npc/re/scripts_main.conf", false); @@ -4390,7 +4396,7 @@ struct map_zone_data *map_merge_zone(struct map_zone_data *main, struct map_zone nullpo_retr(NULL, main); nullpo_retr(NULL, other); - sprintf(newzone, "%s+%s",main->name,other->name); + snprintf(newzone, MAP_ZONE_NAME_LENGTH, "%s+%s", main->name, other->name); if( (zone = strdb_get(map->zone_db, newzone)) ) return zone;/* this zone has already been merged */ |