Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with the EffectContext, TargetData and AddTargetData in the Shotgun Instant GA #36

Open
Aziryel opened this issue Nov 8, 2022 · 3 comments

Comments

@Aziryel
Copy link

Aziryel commented Nov 8, 2022

When I try to run the HandleTargetData custom event in the Shotgun Instant GA everything runs just fine until I get to the AddTargetData, if I use a print before that (Get Effect Context) everything runs but after I connect the Get Effect Context to the AddTargetData and I try to run it, it crashes. Please help!

@Aziryel
Copy link
Author

Aziryel commented Nov 9, 2022

I managed to focus the issue to the AddTargetData, for some reason after the EffectContext is assigned using the static_cast and the EffectContext->AddTargetData(TargetData) is called the engine crashes and the AddTargetData is not even called (I tried by using an UE_LOG but nothing happens. I already checked if the EffectContext was valid and if the TargetData has the information and I was able to obtain the actors and hitResults so they are both valid but the AddTargetData is not working, any idea why?

@ameaninglessname
Copy link

Does the EffectContext have "correct" type for static_cast,
it's not null dost not mean valid, static_cast only checks at compile-time.

Or the AddTargetData is overridden by derived class causing the crash?

@Aziryel
Copy link
Author

Aziryel commented Nov 10, 2022

Yeah the static_cast for the EffectContext is the same as in the GSShooter,
FGASGameplayEffectContext* EffectContext = static_cast<FGASGameplayEffectContext*>(EffectContextHandle.Get());
FGASGameplayEffectContext being the same as FGSGameplayEffectContext and the EffectContextHandle is the type FGameplayEffectContextHandle.

The AddTargetData function is in the structure FGASGameplayEffectContext but the engine crashes before it can fully call it by EffectContext->AddTargetData(TargetData)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants