Permalink
Browse files

Adjusted reload item database (#3849)

* Reloading the item database will now properly force a recalc on all players.
* If new item combos were added to the database and players were wearing the item combo the players would never get the bonus until unequipping and reequipping.
Thanks to @Lemongrass3110!
  • Loading branch information...
aleos89 committed Jan 11, 2019
1 parent 7282dd8 commit 444d7394c2ea53e4875acc4bbac957cdd6fe99de
Showing with 9 additions and 9 deletions.
  1. +9 −9 src/map/itemdb.cpp
@@ -1974,21 +1974,21 @@ void itemdb_reload(void) {
iter = mapit_geteachpc();
for( sd = (struct map_session_data*)mapit_first(iter); mapit_exists(iter); sd = (struct map_session_data*)mapit_next(iter) ) {
memset(sd->item_delay, 0, sizeof(sd->item_delay)); // reset item delays
pc_setinventorydata(sd);
pc_check_available_item(sd, ITMCHK_ALL); // Check for invalid(ated) items.
/* clear combo bonuses */
if( sd->combos.count ) {

if( sd->combos.count ) { // clear combo bonuses
aFree(sd->combos.bonus);
aFree(sd->combos.id);
aFree(sd->combos.pos);
sd->combos.bonus = NULL;
sd->combos.id = NULL;
sd->combos.pos = NULL;
sd->combos.bonus = nullptr;
sd->combos.id = nullptr;
sd->combos.pos = nullptr;
sd->combos.count = 0;
if( pc_load_combo(sd) > 0 )
status_calc_pc(sd, SCO_FORCE);
}

pc_setinventorydata(sd);
pc_check_available_item(sd, ITMCHK_ALL); // Check for invalid(ated) items.
pc_load_combo(sd); // Check to see if new combos are available
status_calc_pc(sd, SCO_FORCE); //
}
mapit_free(iter);
}

0 comments on commit 444d739

Please sign in to comment.