Bug 5576 - Utilize CTFWeaponBaseMelee::CalcIsAttackCriticalHelperNoCrits(), CTFWeaponBase::CalcIsAttackCriticalHelperNoCrits(), and CTFKnife::CalcIsAttackCriticalHelper() in TF2_CalcIsAttackCritical forward
Utilize CTFWeaponBaseMelee::CalcIsAttackCriticalHelperNoCrits(), CTFWeaponBas...
Status: RESOLVED FIXED
Product: SourceMod
Classification: Unclassified
Component: TF2
master
All All
: P5 enhancement
Assigned To: SourceMod Bugs
: needscheckin
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-07 18:27 PST by FlaminSarge
Modified: 2013-08-11 17:19 PDT (History)
3 users (show)

See Also:


Attachments
Patch for crit forward (5.71 KB, patch)
2013-04-16 02:37 PDT, FlaminSarge
no flags Details | Diff | Splinter Review
Patch for TF2 ext (6.85 KB, patch)
2013-04-16 13:06 PDT, FlaminSarge
no flags Details | Diff | Splinter Review
Patch for tf2 ext, round 2 (6.94 KB, patch)
2013-04-17 13:04 PDT, FlaminSarge
no flags Details | Diff | Splinter Review
Patch for tf2 ext, round 3 (6.94 KB, patch)
2013-04-17 17:01 PDT, FlaminSarge
no flags Details | Diff | Splinter Review
Patch for TF2 ext, round 4 (6.94 KB, patch)
2013-05-25 15:10 PDT, FlaminSarge
no flags Details | Diff | Splinter Review
Patch for TF2 crit forward, round 5 (6.88 KB, patch)
2013-07-13 21:16 PDT, FlaminSarge
no flags Details | Diff | Splinter Review
Patch for TF2 crit forward, round 5 (6.88 KB, patch)
2013-07-13 21:21 PDT, FlaminSarge
asherkin: review+
Details | Diff | Splinter Review

Description FlaminSarge 2013-01-07 18:27:53 PST
Presumably, these two are used in place of the default CalcIsAttackCritical stuff when tf_weapon_criticals is set to 0, a situation in which the forward currently fails to do anything.

Side note, CTFWeaponBaseMelee::CalcIsAttackCritical() calls/returns CTFWeaponBase::CalcIsAttackCritical() UNLESS the weapon's owner has a property (I believe it's m_iNextMeleeCrit) set to 2. In this other case, it returns 1.

Would it be an issue to detour both, since one calls the other on occasion?

Either way, they should be used in the forward so that it works when random crits are disabled.
Comment 1 FlaminSarge 2013-01-09 00:17:59 PST
(In reply to comment #0)
Sorry, when I mentioned CalcIsAttackCritical() above I was referring to CalcIsAttackCriticalHelperNoCrits().
Comment 2 FlaminSarge 2013-04-16 02:37:28 PDT
Created attachment 3336 [details] [review]
Patch for crit forward

This should do the trick.

This accounts for the melee one calling the non-melee one under certain conditions so that the forward doesn't fire off twice.
Comment 3 FlaminSarge 2013-04-16 13:06:50 PDT
Created attachment 3337 [details] [review]
Patch for TF2 ext

Added CTFKnife::CalcIsAttackCriticalHelper, which apparently isn't caught by the current crit forward.
Comment 4 FlaminSarge 2013-04-17 13:04:24 PDT
Created attachment 3338 [details] [review]
Patch for tf2 ext, round 2

Forgot to #include "util.h"

:MIB: Asherkin: please don't submit anything without at least making sure it compiles

Sorry.
Comment 5 FlaminSarge 2013-04-17 17:01:14 PDT
Created attachment 3339 [details] [review]
Patch for tf2 ext, round 3

Fixed CTFKnife::CalcIsAttackCriticalHelper Windows sig.
Comment 6 FlaminSarge 2013-05-25 15:10:50 PDT
Created attachment 3355 [details] [review]
Patch for TF2 ext, round 4

The CalcCriticalNoCritsMelee sig changed with some post-SteamPipe update.
Comment 7 FlaminSarge 2013-07-13 21:16:54 PDT
Created attachment 3437 [details] [review]
Patch for TF2 crit forward, round 5

The signatures for CTFKnife::CalcIsAttackCriticalHelper and CTFWeaponBaseMelee::CalcIsAttackCriticalHelperNoCrits changed once again.
Comment 8 FlaminSarge 2013-07-13 21:21:53 PDT
Created attachment 3438 [details] [review]
Patch for TF2 crit forward, round 5

Sorry, uploaded the wrong patch.
Comment 9 FlaminSarge 2013-08-11 17:19:36 PDT
Pushed changeset: http://hg.alliedmods.net/sourcemod-central/rev/608bc5be1ef0
Changelog:
	Add support for more CalcIsAttackCritical helpers. (bug 5576,  r=asherkin)

Note You need to log in before you can comment on or make changes to this bug.