diff options
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index 85d00515c..a7aca10b9 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -792,13 +792,13 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type) switch (bl->type) { case BL_MOB: - if (maplist[bl->m].flag.monster_noteleport && ((TBL_MOB*)bl)->master_id == 0) + if (map->list[bl->m].flag.monster_noteleport && ((TBL_MOB*)bl)->master_id == 0) return 1; - if (m != bl->m && maplist[m].flag.nobranch && battle_config.mob_warp&4 && !(((TBL_MOB *)bl)->master_id)) + if (m != bl->m && map->list[m].flag.nobranch && battle_config.mob_warp&4 && !(((TBL_MOB *)bl)->master_id)) return 1; break; case BL_PC: - if (maplist[bl->m].flag.noteleport) + if (map->list[bl->m].flag.noteleport) return 1; break; } @@ -806,17 +806,17 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type) if (x<0 || y<0) { //Random map position. if (!map->search_freecell(NULL, m, &x, &y, -1, -1, 1)) { - ShowWarning("unit_warp failed. Unit Id:%d/Type:%d, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, maplist[m].name, x, y); + ShowWarning("unit_warp failed. Unit Id:%d/Type:%d, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, map->list[m].name, x, y); return 2; } } else if (map->getcell(m,x,y,CELL_CHKNOREACH)) { //Invalid target cell - ShowWarning("unit_warp: Specified non-walkable target cell: %d (%s) at [%d,%d]\n", m, maplist[m].name, x,y); + ShowWarning("unit_warp: Specified non-walkable target cell: %d (%s) at [%d,%d]\n", m, map->list[m].name, x,y); if (!map->search_freecell(NULL, m, &x, &y, 4, 4, 1)) { //Can't find a nearby cell - ShowWarning("unit_warp failed. Unit Id:%d/Type:%d, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, maplist[m].name, x, y); + ShowWarning("unit_warp failed. Unit Id:%d/Type:%d, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, map->list[m].name, x, y); return 2; } } @@ -1955,7 +1955,7 @@ int unit_skillcastcancel(struct block_list *bl,int type) return 0; if (sd && (sd->special_state.no_castcancel2 || - ((sd->sc.data[SC_UNLIMITED_HUMMING_VOICE] || sd->special_state.no_castcancel) && !map_flag_gvg(bl->m) && !maplist[bl->m].flag.battleground))) //fixed flags being read the wrong way around [blackhole89] + ((sd->sc.data[SC_UNLIMITED_HUMMING_VOICE] || sd->special_state.no_castcancel) && !map_flag_gvg(bl->m) && !map->list[bl->m].flag.battleground))) //fixed flags being read the wrong way around [blackhole89] return 0; } @@ -2174,7 +2174,7 @@ int unit_remove_map(struct block_list *bl, clr_type clrtype, const char* file, i guild->send_dot_remove(sd); bg->send_dot_remove(sd); - if( maplist[bl->m].users <= 0 || sd->state.debug_remove_map ) { + if( map->list[bl->m].users <= 0 || sd->state.debug_remove_map ) { // this is only place where map users is decreased, if the mobs were removed too soon then this function was executed too many times [FlavioJS] if( sd->debug_file == NULL || !(sd->state.debug_remove_map) ) { sd->debug_file = ""; @@ -2188,17 +2188,17 @@ int unit_remove_map(struct block_list *bl, clr_type clrtype, const char* file, i " Please report this!!!\n", sd->status.account_id, sd->status.char_id, sd->state.active, sd->state.connect_new, sd->state.rewarp, sd->state.changemap, sd->state.debug_remove_map, - maplist[bl->m].name, maplist[bl->m].users, + map->list[bl->m].name, map->list[bl->m].users, sd->debug_file, sd->debug_line, sd->debug_func, file, line, func); - } else if (--maplist[bl->m].users == 0 && battle_config.dynamic_mobs) //[Skotlex] + } else if (--map->list[bl->m].users == 0 && battle_config.dynamic_mobs) //[Skotlex] map->removemobs(bl->m); if( !(sd->sc.option&OPTION_INVISIBLE) ) { // decrement the number of active pvp players on the map - --maplist[bl->m].users_pvp; + --map->list[bl->m].users_pvp; } - if( maplist[bl->m].instance_id >= 0 ) { - instance->list[maplist[bl->m].instance_id].users--; - instance->check_idle(maplist[bl->m].instance_id); + if( map->list[bl->m].instance_id >= 0 ) { + instance->list[map->list[bl->m].instance_id].users--; + instance->check_idle(map->list[bl->m].instance_id); } sd->state.debug_remove_map = 1; // temporary state to track double remove_map's [FlavioJS] sd->debug_file = file; @@ -2340,7 +2340,7 @@ int unit_free(struct block_list *bl, clr_type clrtype) { duel->reject(sd->duel_invite, sd); // Notify friends that this char logged out. [Skotlex] - map->map_foreachpc(clif->friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 0); + map->foreachpc(clif->friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 0); party->send_logout(sd); guild->send_memberinfoshort(sd,0); pc->cleareventtimer(sd); |