#CBaseMonster::TraceAttack() missing pevInflictor

1 messages · Page 1 of 1 (latest)

dry condor
#

Since the 5.26 update it now pass pevAttacker as the actual attacker (as it should). Some custom monster scripts relying on whatever inflicted it beside of the real attacker are now broken.
For example the env_laser's in of6a5 when a player is using one of those func_tanklaser_of it was the laser being passed as the pevAttacker in the earlier versions. Now it is the player instead.

tidal yoke
#

Are you talking about a script or something?

#

The Geneworm isn't available in 5.26, it's coming to 5.27.

dry condor
tidal yoke
#

The scripts will need to be updated.

dry condor
tidal yoke
#

The script needs to be modified to work with pevAttacker

dry condor
tidal yoke
#

Thinking...

#

@dry condor This will probably be your solution.

Step 1.
In TraceAttack():

  • Check for bitsDamageType & DMG_ENERGYBEAM targeting corresponding hitbox you care about.
  • If true, store who the attacker was and which hitbox.

Step 2.
In TakeDamage():

  • Check if inflictor is env_laser
  • If true, check stored variables for last attacker (if they are the player) and which hitbox was hit.
  • Apply AI logic to the corresponding hitbox (e.g. eye closing, etc.).
  • Clear the variables stored in TraceAttack().
#

I might be missing a few pieces, but that should get close to what you need.

dry condor
#

I hate these type of workarounds otis

tidal yoke
#

"left_eye_laser" / "right_eye_laser" is the targetnames of the env_laser used by of6a5. You can probably use that too.

#

Well, it's actually a pretty good solution, because TraceAttack() is processed before TakeDamage() in the same frame.

#

So you can put those two functions together. You're really just maintaining the state until TakeDamage() finishes.

dry condor
#

I can't use CBaseMonster::TakeDamage() because I have blocked it to prevent Displacer from killing it (if I remember correctly, it applies FL_KILLME flag).