Function Detouring / Overriding Multiple Times
-
So I made a script that successfully sets the gavaknuckles to 1,000,000 damage, the only issue is when I combine this with another script that also detours level.callbackactordamage, one of the detours does not work. Specifically, I am trying to use this in conjunction with
https://forum.plutonium.pw/topic/32538/release-zm-black-ops-2-custom-perks?_=1721359339869
I don't see an issue with multiple detours myself, in my mind the first detour would simple execute the second detour's level.callbackactordamage which would then execute the original level.callbackactordamage, though this doesn't seem to be what is happening. How can I make both of these scripts work together? Also, the second script does not call the original function level.callbackactordamagestub, it calls it level.originalcallbackactordamage, which should mean that it is not being overriden.init() { level.callbackactordamagestub = level.callbackactordamage; level.callbackactordamage = ::buffDamage; } buffDamage( inflictor, attacker, damage, flags, meansofdeath, weapon, vpoint, vdir, shitloc, psoffsettime, boneindex ) { if (isDefined( attacker ) && isplayer( attacker )) { if (weapon == "tazer_knuckles_zm") { damage = 1000000; } } self [[level.callbackactordamagestub]]( inflictor, attacker, damage, flags, meansofdeath, weapon, vpoint, vdir, shitloc, psoffsettime, boneindex ); }
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login