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

Rework damage handling #490

Open
SamVanheer opened this issue Jun 26, 2023 · 0 comments
Open

Rework damage handling #490

SamVanheer opened this issue Jun 26, 2023 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@SamVanheer
Copy link
Collaborator

SamVanheer commented Jun 26, 2023

Rework damage handling to eliminate the use of global variables and fix bugs.

Pass parameters to TakeDamage using a structure containing relevant information.

This structure can also be used to pass information to TraceAttack and Killed.

g_vecAttackDir is set in TakeDamage but is used in TraceAttack which is called before TakeDamage.

Pass the correct attacker in func_tank entities. Note that the Gene Worm expects the attacker to be the tank itself (inflictor), not the attacker so that logic needs changing to function correctly.

There may be other entities that expect the attacker to actually be in the inflictor so this needs extensive testing.

Redesigning the multi-damage functionality to store its results in a structure based to TraceAttack can help eliminate edge cases resulting for leftover global state.

@SamVanheer SamVanheer added bug Something isn't working enhancement New feature or request labels Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant