瀏覽代碼

- Vending shops are now closed when warping to novending maps/cells. (bugreport:6871)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16879 54d463be-8e91-2dee-dedb-b68131a5f0ec
brianluau 12 年之前
父節點
當前提交
347412ef7e
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      src/map/pc.c

+ 11 - 0
src/map/pc.c

@@ -4658,6 +4658,12 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
 		bg_send_dot_remove(sd);
 		if (sd->regen.state.gc)
 			sd->regen.state.gc = 0;
+		// make sure vending is allowed here
+		if (sd->state.vending && map[m].flag.novending) {
+				clif_displaymessage (sd->fd, msg_txt(276)); // "You can't open a shop on this map"
+				vending_closevending(sd);
+			}
+		}
 	}
 
 	if( m < 0 )
@@ -4700,6 +4706,11 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
 		} while(map_getcell(m,x,y,CELL_CHKNOPASS));
 	}
 
+	if (sd->state.vending && map_getcell(m,x,y,CELL_CHKNOVENDING)) {
+		clif_displaymessage (sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
+		vending_closevending(sd);
+	}
+
 	if(sd->bl.prev != NULL){
 		unit_remove_map_pc(sd,clrtype);
 		clif_changemap(sd,map[m].index,x,y); // [MouseJstr]