Refactored item bonuses to utilize C++ features (#3235)

* Fixes #996 and fixes #3152.
* Refactored MAX_PC_BONUS item bonuses from static arrays to vectors.
* Increased MAX_PC_BONUS to 50.
* Frees up memory from players that may not ever utilize all their static MAX_PC_BONUS item bonuses.
* Expanded bonus ResEff to not be restricted to SC_COMMON* statuses.
* Removed old ERS usages.
* Removed code redundancy and general cleanups.
Thanks to @Angelic234, @Atemo, @Lemongrass3110, and @Everade!
This commit is contained in:
Aleos
2018-11-28 21:50:43 -05:00
committed by GitHub
parent eafb1cb7f9
commit c71ef92fb0
8 changed files with 787 additions and 888 deletions

View File

@@ -3187,9 +3187,10 @@ int unit_free(struct block_list *bl, clr_type clrtype)
pc_setrestartvalue(sd,2);
pc_delinvincibletimer(sd);
pc_delautobonus(sd,sd->autobonus,ARRAYLENGTH(sd->autobonus),false);
pc_delautobonus(sd,sd->autobonus2,ARRAYLENGTH(sd->autobonus2),false);
pc_delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus3),false);
pc_delautobonus(sd, sd->autobonus, false);
pc_delautobonus(sd, sd->autobonus2, false);
pc_delautobonus(sd, sd->autobonus3, false);
if( sd->followtimer != INVALID_TIMER )
pc_stop_following(sd);
@@ -3257,8 +3258,6 @@ int unit_free(struct block_list *bl, clr_type clrtype)
// Clearing...
if (sd->bonus_script.head)
pc_bonus_script_clear(sd, BSF_REM_ALL);
pc_itemgrouphealrate_clear(sd);
break;
}
case BL_PET: {