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

Medical - Add framework for pain dynamics || Improve code readability and error handling #95

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fedoraman737
Copy link

When merged this pull request will:

  • Add a framework for dynamic pain management, providing more detailed control over pain thresholds and their effects.
  • Improve code readability by refactoring methods, reducing redundancy, and ensuring consistent naming.
  • Enhance error handling with added null checks and logging for critical operations.
  • Ensure consistent state replication across the network using RplProp for key variables.
  • Improve debugging and tracking by logging important state changes, like enabling/disabling second chance and adjusting pain intensity levels.
  • Minor naming corrections to some methods

//------------------------------------------------------------------------------------------------
//! Initialize member variables
//! Initialize member variables.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the other doc blocks end with a punctuation, keep consistent

Suggested change
//! Initialize member variables.
//! Initialize member variables


//------------------------------------------------------------------------------------------------
//! Handle logic when character is revived (ALIVE state)
void HandleAliveState()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a public API

Suggested change
void HandleAliveState()
protected void HandleAliveState()


//------------------------------------------------------------------------------------------------
//! Handle logic when character is incapacitated (INCAPACITATED state)
void HandleIncapacitatedState()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void HandleIncapacitatedState()
protected void HandleIncapacitatedState()


//------------------------------------------------------------------------------------------------
//! Handle logic when character is dead (DEAD state)
void HandleDeadState()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void HandleDeadState()
protected void HandleDeadState()

Comment on lines -18 to -20
// We only notify the replication system about changes of these members on initialization
// After init, each proxy is itself responsible for updating these members
// Having them as RplProp also ensures that JIPs receive the current state from the server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the point of removing a useful comment.

m_bACE_Medical_Initialized = true;
Replication.BumpMe();

// Log successful initialization
Print("ACE Medical: Initialized with second chance enabled.", LogLevel.INFO);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add info about m_bSecondChanceOnHeadEnabled, m_fSecondChanceRegenScale values here?

@veteran29
Copy link
Member

  • Add a framework for dynamic pain management, providing more detailed control over pain thresholds and their effects.
  • Enhance error handling with added null checks and logging for critical operations.
  • Ensure consistent state replication across the network using RplProp for key variables.

I don't see any of this in the PR, and in general it would make sense to keep them separate from the minor refactor so it's easier to review.

@Kexanone Kexanone added this to the Ongoing milestone Oct 21, 2024
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

Successfully merging this pull request may close these issues.

3 participants