diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-07-27 00:11:32 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-07-27 00:11:32 +0000 |
commit | 96cc4f2e7496202c8c278399124f9f85ce3a5ae5 (patch) | |
tree | 7455cde7f3b96c014e441b58662630910f49ed36 /src/map/unit.c | |
parent | 679b172c58b43307a8e25ba85bae0d83f8598926 (diff) | |
download | hercules-96cc4f2e7496202c8c278399124f9f85ce3a5ae5.tar.gz hercules-96cc4f2e7496202c8c278399124f9f85ce3a5ae5.tar.bz2 hercules-96cc4f2e7496202c8c278399124f9f85ce3a5ae5.tar.xz hercules-96cc4f2e7496202c8c278399124f9f85ce3a5ae5.zip |
Fixed bugreport:309 combos may now stack properly. moved all combo processing out of item bonuses and made it's own processing scheme, which is by far more efficient cpu-wise although it requires a little more memory, instead of checking for combo items whenever a status effect is turned on/off it only checks when equipping/un-equipping a item (and on login). Special Thanks to GreenBox, Kenpachi, Skotlex and Trojal
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16508 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index 63b2805fb..a65aafb97 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2254,14 +2254,12 @@ int unit_free(struct block_list *bl, clr_type clrtype) pc_inventory_rental_clear(sd); pc_delspiritball(sd,sd->spiritball,1); - if( sd->reg ) - { //Double logout already freed pointer fix... [Skotlex] + if( sd->reg ) { //Double logout already freed pointer fix... [Skotlex] aFree(sd->reg); sd->reg = NULL; sd->reg_num = 0; } - if( sd->regstr ) - { + if( sd->regstr ) { int i; for( i = 0; i < sd->regstr_num; ++i ) if( sd->regstr[i].data ) @@ -2270,12 +2268,16 @@ int unit_free(struct block_list *bl, clr_type clrtype) sd->regstr = NULL; sd->regstr_num = 0; } - if( sd->st && sd->st->state != RUN ) - {// free attached scripts that are waiting + if( sd->st && sd->st->state != RUN ) {// free attached scripts that are waiting script_free_state(sd->st); sd->st = NULL; sd->npc_id = 0; } + if( sd->combos.count ) { + aFree(sd->combos.bonus); + aFree(sd->combos.id); + sd->combos.count = 0; + } break; } case BL_PET: |