Skip to content

Commit

Permalink
fix only one effect triggering
Browse files Browse the repository at this point in the history
  • Loading branch information
direwolf420 committed Aug 23, 2020
1 parent 40c3615 commit 49bfcd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Core/ROREffects/Common/StickyBombEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public override string UIInfo()

public override float Chance => 0.08f;

void IOnHit.OnHitNPC(Player player, Item item, NPC target, int damage, float knockback, bool crit)
public void OnHitNPC(Player player, Item item, NPC target, int damage, float knockback, bool crit)
{
SpawnProjectile(player, target);
}

void IOnHit.OnHitNPCWithProj(Player player, Projectile proj, NPC target, int damage, float knockback, bool crit)
public void OnHitNPCWithProj(Player player, Projectile proj, NPC target, int damage, float knockback, bool crit)
{
SpawnProjectile(player, target);
}
Expand Down
10 changes: 8 additions & 2 deletions Core/ROREffects/ROREffectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,14 @@ public static bool CanDoEffect<T>(ROREffect effect) where T : IROREffectInterfac
RORPlayer mPlayer = effect.Player.GetRORPlayer();
if (mPlayer.CanProc())
{
mPlayer.SetProcTimer();
return effect.Proc();
//If ProcTimer is 0
bool result = effect.Proc();
if (result)
{
//If proced, set timer
mPlayer.SetProcTimer();
}
return result;
}
return false;
}
Expand Down

0 comments on commit 49bfcd3

Please sign in to comment.