Skip to content

Commit

Permalink
Removed un-necessary code responsible for erroneous effect stacking
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackDog86 committed Jan 6, 2025
1 parent 3ce4635 commit 887c081
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,15 @@ function PostCreateInit(EffectAppliedData InApplyEffectParameters, GameRuleState
if (EffectTemplate.bStackOnRefresh)
{
iStacks = 1;
AbilityContext = XComGameStateContext_Ability(NewGameState.GetContext());

// Start Issue #1380
/// HL-Docs: ref:Bugfixes; issue:1380
/// Fix bug where burst fire abilities with stacking effects would apply the wrong number of effect stacks to the
/// target. Since X2AbilityMultiTarget_Burstfire behaves like completely independant shots, the stacking effects are
/// routed through the onRefresh function for each shot, so it is not necessary to adjust the amount of effect stacks
/// applied by the Number of additional shots that will be fired in the burst.

/*AbilityContext = XComGameStateContext_Ability(NewGameState.GetContext());
if (AbilityContext != none && AbilityContext.InputContext.PrimaryTarget.ObjectID == ApplyEffectParameters.TargetStateObjectRef.ObjectID)
{
AbilityTemplate = class'X2AbilityTemplateManager'.static.GetAbilityTemplateManager().FindAbilityTemplate(AbilityContext.InputContext.AbilityTemplateName);
Expand All @@ -278,7 +286,8 @@ function PostCreateInit(EffectAppliedData InApplyEffectParameters, GameRuleState
iStacks += BurstFire.NumExtraShots;
}
}
}
}*/
// End Issue #1380
}

PlayerState = XComGameState_Player(History.GetGameStateForObjectID(ApplyEffectParameters.PlayerStateObjectRef.ObjectID));
Expand Down Expand Up @@ -393,7 +402,9 @@ function OnRefresh(EffectAppliedData NewApplyEffectParameters, XComGameState New
if (EffectTemplate.bStackOnRefresh)
{
iStacks++;
AbilityContext = XComGameStateContext_Ability(NewGameState.GetContext());
// Start Issue #1380 - Since onRefresh will be called for each burst-fire shot, we don't need to adjust the number of effect stacks
// by the number of burst fire shots here either.
/*AbilityContext = XComGameStateContext_Ability(NewGameState.GetContext());
if (AbilityContext != none && AbilityContext.InputContext.PrimaryTarget.ObjectID == ApplyEffectParameters.TargetStateObjectRef.ObjectID)
{
AbilityTemplate = class'X2AbilityTemplateManager'.static.GetAbilityTemplateManager().FindAbilityTemplate(AbilityContext.InputContext.AbilityTemplateName);
Expand All @@ -405,7 +416,8 @@ function OnRefresh(EffectAppliedData NewApplyEffectParameters, XComGameState New
iStacks += BurstFire.NumExtraShots;
}
}
}
}*/
// End Issue #1380
}

// Start Issue #475
Expand Down

0 comments on commit 887c081

Please sign in to comment.