Raised This Month: $51 Target: $400
 12% 

How to detect when Cow Mangler disables a building


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wliu
Veteran Member
Join Date: Apr 2013
Old 01-09-2016 , 17:33   How to detect when Cow Mangler disables a building
Reply With Quote #1

I did a few tests using hints from FlaminSarge and still can't figure this one out. Is there any way to detect when the Cow Mangler disables a building? I've tried logging the sentry's m_iState and hooking OnObjectSapped, but the first doesn't change to anything unique and the second isn't even fired. Preferably I'd like a solution that doesn't run on a timer or hooks every single building out there, but if it's absolutely necessary, *shrug*.

And as usual, a second totally-unrelated question: how would you add ammo to Jarate/Mad Milk? m_iClip1 returns -1 until you manually set it (which breaks the recharge meter but sets the ammo correctly) and m_iAmmo returns 0 no matter what.
__________________
~Wliu
Wliu is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-10-2016 , 09:07   Re: How to detect when Cow Mangler disables a building
Reply With Quote #2

In an OnTakeDamage hook on the object, check for the object not already being disabled and a damage custom value of TF_DMG_CUSTOM_PLASMA_CHARGED.
psychonic is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 01-12-2016 , 18:21   Re: How to detect when Cow Mangler disables a building
Reply With Quote #3

Thanks psychonic: it worked!
__________________
~Wliu
Wliu is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode