Преглед изворни кода

Bug Fixes
* Follow up to ce7aacb - Adjusted status_calc_bl_main() to calculate player status data through battle_status, not base_status.
* Fixes #709 - Corrected a missed variable type conversion from 82467e1. Thanks to @theultramage.

aleos89 пре 9 година
родитељ
комит
da94f41908
2 измењених фајлова са 8 додато и 3 уклоњено
  1. 1 1
      src/char/int_storage.c
  2. 7 2
      src/map/status.c

+ 1 - 1
src/char/int_storage.c

@@ -316,7 +316,7 @@ int mapif_parse_itembound_retrieve(int fd)
 	SqlStmt_BindColumn(stmt, 7, SQLDT_UINT,      &item.expire_time, 0, NULL, NULL);
 	SqlStmt_BindColumn(stmt, 7, SQLDT_UINT,      &item.expire_time, 0, NULL, NULL);
 	SqlStmt_BindColumn(stmt, 8, SQLDT_UINT,      &item.bound,       0, NULL, NULL);
 	SqlStmt_BindColumn(stmt, 8, SQLDT_UINT,      &item.bound,       0, NULL, NULL);
 	for( j = 0; j < MAX_SLOTS; ++j )
 	for( j = 0; j < MAX_SLOTS; ++j )
-		SqlStmt_BindColumn(stmt, 9+j, SQLDT_SHORT, &item.card[j], 0, NULL, NULL);
+		SqlStmt_BindColumn(stmt, 9+j, SQLDT_USHORT, &item.card[j], 0, NULL, NULL);
 
 
 	memset(&items, 0, sizeof(items));
 	memset(&items, 0, sizeof(items));
 	while( SQL_SUCCESS == SqlStmt_NextRow(stmt) )
 	while( SQL_SUCCESS == SqlStmt_NextRow(stmt) )

+ 7 - 2
src/map/status.c

@@ -2955,7 +2955,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt)
 {
 {
 	static int calculating = 0; ///< Check for recursive call preemption. [Skotlex]
 	static int calculating = 0; ///< Check for recursive call preemption. [Skotlex]
 	struct status_data *base_status; ///< Pointer to the player's base status
 	struct status_data *base_status; ///< Pointer to the player's base status
-	short bStr = 0, bAgi = 0, bVit = 0, bInt_ = 0, bDex = 0, bLuk = 0; ///< Stat addition to the player's base status
+	short bStr = 0, bAgi = 0, bVit = 0, bInt_ = 0, bDex = 0, bLuk = 0; ///< Stat addition to the player's battle status
 	const struct status_change *sc = &sd->sc;
 	const struct status_change *sc = &sd->sc;
 	struct s_skill b_skill[MAX_SKILL]; ///< Previous skill tree
 	struct s_skill b_skill[MAX_SKILL]; ///< Previous skill tree
 	int b_weight, b_max_weight, b_cart_weight_max, ///< Previous weight
 	int b_weight, b_max_weight, b_cart_weight_max, ///< Previous weight
@@ -4296,12 +4296,17 @@ void status_calc_state( struct block_list *bl, struct status_change *sc, enum sc
  */
  */
 void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
 void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
 {
 {
-	const struct status_data *b_status = status_get_base_status(bl);
+	const struct status_data *b_status;
 	struct status_data *status = status_get_status_data(bl);
 	struct status_data *status = status_get_status_data(bl);
 	struct status_change *sc = status_get_sc(bl);
 	struct status_change *sc = status_get_sc(bl);
 	TBL_PC *sd = BL_CAST(BL_PC,bl);
 	TBL_PC *sd = BL_CAST(BL_PC,bl);
 	int temp;
 	int temp;
 
 
+	if (bl->type == BL_PC)
+		b_status = &sd->battle_status;
+	else
+		b_status = status_get_base_status(bl);
+
 	if (!b_status || !status)
 	if (!b_status || !status)
 		return;
 		return;