Explorar o código

Fixed unitwarp to unwalkable areas for NPCs

Fixed #2270

Thanks to @Yuchinin
Lemongrass3110 %!s(int64=7) %!d(string=hai) anos
pai
achega
dae5030650
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/map/unit.c

+ 1 - 1
src/map/unit.c

@@ -1197,7 +1197,7 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type)
 			return 2;
 
 		}
-	} else if (map_getcell(m,x,y,CELL_CHKNOREACH)) { // Invalid target cell
+	} else if ( bl->type != BL_NPC && 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, map[m].name, x,y);
 
 		if (!map_search_freecell(NULL, m, &x, &y, 4, 4, 1)) { // Can't find a nearby cell