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

Misc. predator fixes #261

Merged

Conversation

Blixibon
Copy link
Collaborator

@Blixibon Blixibon commented Mar 8, 2024

This PR fixes the following issues involving predators, especially gonomes:

  • Predators will now only melee attack enemies within a certain Z range, which is calculated using hull height and/or the distance between the enemy's origin and eye position, depending on if the predator's target is a NPC or player. This fixes issues with predators getting stuck in a loop trying to attack enemies that are outside of its melee trace height (e.g. on displacements in the Xentarium).
  • Predators won't hurthop when alert if they last saw an enemy less than 5 seconds ago. Being attacked while hunting prey also won't cause the predator to stop hunting if the attacker was the prey itself (checked by evaluating m_flLastHurtTime, which is only assigned when attacked by non-prey). This fixes gonomes getting caught in a loop while fighting citizens.
  • Remove redundant functions on CNPC_Gonome which overrode CNPC_BasePredator functionality, most importantly m_nextSoundTime.
  • Move CNPC_Gonome::m_poseArmsOut initialization to SetupGlobalModelData(), which is more appropriate and properly runs on save/restore.
  • Fix m_nextSoundTime random value using the wrong data type.

@Blixibon Blixibon requested a review from 1upD March 8, 2024 02:13
Copy link

@1upD 1upD left a comment

Choose a reason for hiding this comment

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

I have a couple of questions about the methods removed from npc_zassassin.cpp. No changes needed but I want to make sure we tested to make sure the functionality is the same or improved

sp/src/game/server/ez2/npc_basepredator.cpp Show resolved Hide resolved
sp/src/game/server/ez2/npc_zassassin.cpp Show resolved Hide resolved
sp/src/game/server/ez2/npc_zassassin.cpp Show resolved Hide resolved
@Blixibon Blixibon force-pushed the ez2/feature/predator-misc-fixes branch from 82562db to d59c5ce Compare March 8, 2024 04:15
Copy link

@1upD 1upD left a comment

Choose a reason for hiding this comment

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

LGTM

@1upD 1upD merged commit e8d57b9 into entropy-zero:ez2/mapbase Mar 8, 2024
5 checks passed
met-nikita pushed a commit to met-nikita/source-sdk-2013 that referenced this pull request May 9, 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.

None yet

2 participants