瀏覽代碼

Dancing skills at invalid coordinates

Added a check whether the cells are valid or not.
Fixes: http://rathena.org/board/tracker/issue-8523-using-dance-skills-on-dark-map-will-crash-the-map-server/
http://rathena.org/board/tracker/issue-8317-warning-connection-to-char-server-lost/?st=40
Lemongrass3110 11 年之前
父節點
當前提交
80f7984acc
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/map/skill.c

+ 5 - 0
src/map/skill.c

@@ -11863,6 +11863,11 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, uint16 skill
 		int val2 = 0;
 		int alive = 1;
 
+		// are the coordinates out of range?
+		if( ux <= 0 || uy <= 0 || ux >= map[sd->bl.m].xs || uy >= map[sd->bl.m].ys ){
+			continue;
+		}
+
 		if( !group->state.song_dance && !map_getcell(src->m,ux,uy,CELL_CHKREACH) )
 			continue; // don't place skill units on walls (except for songs/dances/encores)
 		if( battle_config.skill_wall_check && unit_flag&UF_PATHCHECK && !path_search_long(NULL,src->m,ux,uy,x,y,CELL_CHKWALL) )