Enable autobonus to be reactivated (#3199)

* Fixes #3039, #3158
* Thanks to @Raf4h @laziem
This commit is contained in:
Cydh Ramdh 2018-06-28 20:56:39 +07:00 committed by GitHub
parent a4336fd8ae
commit e7fd6aa5bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -2379,6 +2379,9 @@ void pc_exeautobonus(struct map_session_data *sd,struct s_autobonus *autobonus)
if (!sd || !autobonus)
return;
if (autobonus->active != INVALID_TIMER)
delete_timer(autobonus->active, pc_endautobonus);
if( autobonus->other_script )
{
int j;

View File

@ -2177,8 +2177,6 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
{
if( rnd()%1000 >= sd->autobonus[i].rate )
continue;
if( sd->autobonus[i].active != INVALID_TIMER )
continue;
if(!( ((sd->autobonus[i].atk_type)&attack_type)&BF_WEAPONMASK &&
((sd->autobonus[i].atk_type)&attack_type)&BF_RANGEMASK &&
((sd->autobonus[i].atk_type)&attack_type)&BF_SKILLMASK))
@ -2281,8 +2279,6 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint1
for( i = 0; i < ARRAYLENGTH(sd->autobonus3); i++ ) {
if( rnd()%1000 >= sd->autobonus3[i].rate )
continue;
if( sd->autobonus3[i].active != INVALID_TIMER )
continue;
if( sd->autobonus3[i].atk_type != skill_id )
continue;
pc_exeautobonus(sd,&sd->autobonus3[i]);
@ -2516,8 +2512,6 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
for( i = 0; i < ARRAYLENGTH(dstsd->autobonus2); i++ ) {
if( rnd()%1000 >= dstsd->autobonus2[i].rate )
continue;
if( dstsd->autobonus2[i].active != INVALID_TIMER )
continue;
if(!( ((dstsd->autobonus2[i].atk_type)&attack_type)&BF_WEAPONMASK &&
((dstsd->autobonus2[i].atk_type)&attack_type)&BF_RANGEMASK &&
((dstsd->autobonus2[i].atk_type)&attack_type)&BF_SKILLMASK))