瀏覽代碼

Fixes NoWalkDelay item bonus (#6707)

* Fixes #6636.
* Resolves an issue with NoWalkDelay being checked too late and not properly giving the bonus to the player.
Thanks to @iraciz!
Aleos 3 年之前
父節點
當前提交
bf3b12bc3d
共有 1 個文件被更改,包括 10 次插入6 次删除
  1. 10 6
      src/map/status.cpp

+ 10 - 6
src/map/status.cpp

@@ -7710,15 +7710,19 @@ static short status_calc_aspd_rate(struct block_list *bl, struct status_change *
  */
 static unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion)
 {
-	if( !sc || !sc->count || map_flag_gvg2(bl->m) || map_getmapflag(bl->m, MF_BATTLEGROUND) )
-		return cap_value(dmotion,0,USHRT_MAX);
-
 	/// It has been confirmed on official servers that MvP mobs have no dmotion even without endure
 	if( bl->type == BL_MOB && status_get_class_(bl) == CLASS_BOSS )
 		return 0;
-	if (bl->type == BL_PC && ((TBL_PC *)bl)->special_state.no_walk_delay)
-		return 0;
-	if( sc->data[SC_ENDURE] || sc->data[SC_RUN] || sc->data[SC_WUGDASH] )
+
+	if (bl->type == BL_PC) {
+		if (map_flag_gvg2(bl->m) || map_getmapflag(bl->m, MF_BATTLEGROUND))
+			return (unsigned short)cap_value(dmotion, 0, USHRT_MAX);
+
+		if (((TBL_PC *)bl)->special_state.no_walk_delay)
+			return 0;
+	}
+
+	if (sc && sc->count > 0 && (sc->data[SC_ENDURE] || sc->data[SC_RUN] || sc->data[SC_WUGDASH]))
 		return 0;
 
 	return (unsigned short)cap_value(dmotion,0,USHRT_MAX);