فهرست منبع

Fixed bugreport:5468 Swordsman upper classes and ranger are no longer allowed to use reins of mount (new mounts)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15746 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 سال پیش
والد
کامیت
ca93d7b9cb
3فایلهای تغییر یافته به همراه16 افزوده شده و 1 حذف شده
  1. 6 0
      src/map/atcommand.c
  2. 1 1
      src/map/pc.c
  3. 9 0
      src/map/pc.h

+ 6 - 0
src/map/atcommand.c

@@ -8337,6 +8337,12 @@ ACMD_FUNC(charcommands)
 }
 
 ACMD_FUNC(new_mount) {
+
+	if( pc_cant_newmount(sd) && !(sd->sc.option&OPTION_MOUNTING) ) {
+		clif_displaymessage(sd->fd,"Your character cannot mount a new mount");
+		return -1;
+	}
+
 	clif_displaymessage(sd->fd,"NOTICE: If you crash with mount your LUA is outdated");
 	if( !(sd->sc.option&OPTION_MOUNTING) ) {
 		clif_displaymessage(sd->fd,"You have mounted.");

+ 1 - 1
src/map/pc.c

@@ -6945,7 +6945,7 @@ int pc_setoption(struct map_session_data *sd,int type)
 			status_calc_pc(sd,0); //Remove speed penalty.
 	}
 
-	if (type&OPTION_MOUNTING && !(p_type&OPTION_MOUNTING) && ( sd->class_&MAPID_THIRDMASK ) != MAPID_RANGER ) {
+	if (type&OPTION_MOUNTING && !(p_type&OPTION_MOUNTING) && !pc_cant_newmount(sd) ) {
 		clif_status_load_notick(&sd->bl,SI_ALL_RIDING,2,1,0,0);
 		status_calc_pc(sd,0); 
 	} else if (!(type&OPTION_MOUNTING) && p_type&OPTION_MOUNTING) {

+ 9 - 0
src/map/pc.h

@@ -621,6 +621,15 @@ enum e_pc_permission {
 #define pc_iswug(sd)       ( (sd)->sc.option&OPTION_WUG )
 #define pc_isridingwug(sd) ( (sd)->sc.option&OPTION_WUGRIDER )
 
+/**
+ * New Mounts -- can this damn job not
+ **/
+#define pc_cant_newmount(sd) \
+	( \
+		( (sd)->class_&MAPID_THIRDMASK) == MAPID_RANGER || \
+		( ((sd)->class_&MAPID_BASEMASK) == MAPID_SWORDMAN && (sd)->status.class_ != JOB_SWORDMAN )  \
+	)
+
 #define pc_stop_walking(sd, type) unit_stop_walking(&(sd)->bl, type)
 #define pc_stop_attack(sd) unit_stop_attack(&(sd)->bl)