Uploaded August 2016 | Updated November 2026, 1 day ago
I did two tweaks here for ease of demonstration: (a) made the wrench able to one-hit-remove sappers; and (b) increased the "disable building after sapper removed" time from 0.5 sec to 5.0 sec. Nothing makes sense and the whole thing is an absolute clusterfuck; there's no other way to put it.
So back in the December 17, 2015 Tough Break update, Valve thought it would be a good idea to make the following change: "After removing a Sapper from a sentry, there is now a 0.5s delay before the sentry is active again."
Famously, the disable duration was actually 5.0 seconds, not 0.5, due to apparently not testing anything. This had to be fixed with an update the next day.
Incidentally, the Tough Break patch notes are misleading: the 0.5 second disabled period after un-sapping actually applies to all buildings, not just sentries.
For the new post-sapper-removal activation delay, the Valve devs reused the same "plasma disabled" mechanism that the Cow Mangler 5000's charged shot applies to buildings it hits (in the CM5k's case, the "plasma disabled" duration is 4 seconds).
Before the Cow Mangler existed, CBaseObject::HasSapper returned true if the building was sapped and false if not. But once the Cow Mangler's plasma disable mechanism was introduced, CBaseObject::HasSapper was changed to return true if the building was either sapped OR plasma-disabled. In some senses this is reasonable: for example, TFBots call HasSapper to know if a sentry is a threat to them, and a plasma-disabled sentry is not a threat in the same way that a sapped sentry is not a threat.
But there are certainly respects in which making CBaseObject::HasSapper return true for buildings that are plasma-disabled-but-not-actually-sapped was a horrendously bad idea. Because, believe it or not, there are areas of the game code that call HasSapper and expect the result of that function to tell them if the building, you know, has a sapper, in the actual sense of having a sapper attached to it.
In particular, when applying a sapper to a teleporter, the game code checks if the matching teleporter HasSapper(), and only applies a sapper to the other end of the teleporter if it returned false (this is done in CTFWeaponBuilder::PrimaryAttack). This means that sapping one end of a teleporter when the other end is plasma-disabled will result in only the close end of the teleporter being sapped. The HasSapper check in this case was meant to prevent double-sapping the other end of the teleporter; but because of the screwed-up semantics of HasSapper, it also prevents properly sapping both ends of a tele if the remote end is plasma-disabled.
When this situation occurs, it's impossible to remove the sapper if you're hitting the non-sapped end. Essentially, when you successfully apply damage to a sapper, the sapper will check if it's on a teleporter that has a matching partner, and if so, the sapper will propagate the damage it just took to the sapper on the other end (this happens in CObjectSapper::OnTakeDamage). Hitting the non-sapped end doesn't damage a sapper (because there isn't any sapper there), so the propagate-damage-to-the-other-tele's-sapper logic doesn't happen.
Also, it's not possible to remove sappers from a building when that building is plasma-disabled. This may or may not be intentional; I have no idea. But it manages to make sapper-spamming situations even more obnoxious to deal with than before.
Basically, this is an area of the game that is badly in need of some serious refactoring. What a mess.
I did two tweaks here for ease of demonstration: (a) made the wrench able to one-hit-remove sappers; and (b) increased the "disable building after sapper removed" time from 0.5 sec to 5.0 sec. Nothing makes sense and the whole thing is an absolute clusterfuck; there's no other way to put it.
So back in the December 17, 2015 Tough Break update, Valve thought it would be a good idea to make the following change: "After removing a Sapper from a sentry, there is now a 0.5s delay before the sentry is active again."
Famously, the disable duration was actually 5.0 seconds, not 0.5, due to apparently not testing anything. This had to be fixed with an update the next day.
Incidentally, the Tough Break patch notes are misleading: the 0.5 second disabled period after un-sapping actually applies to all buildings, not just sentries.
For the new post-sapper-removal activation delay, the Valve devs reused the same "plasma disabled" mechanism that the Cow Mangler 5000's charged shot applies to buildings it hits (in the CM5k's case, the "plasma disabled" duration is 4 seconds).
Before the Cow Mangler existed, CBaseObject::HasSapper returned true if the building was sapped and false if not. But once the Cow Mangler's plasma disable mechanism was introduced, CBaseObject::HasSapper was changed to return true if the building was either sapped OR plasma-disabled. In some senses this is reasonable: for example, TFBots call HasSapper to know if a sentry is a threat to them, and a plasma-disabled sentry is not a threat in the same way that a sapped sentry is not a threat.
But there are certainly respects in which making CBaseObject::HasSapper return true for buildings that are plasma-disabled-but-not-actually-sapped was a horrendously bad idea. Because, believe it or not, there are areas of the game code that call HasSapper and expect the result of that function to tell them if the building, you know, has a sapper, in the actual sense of having a sapper attached to it.
In particular, when applying a sapper to a teleporter, the game code checks if the matching teleporter HasSapper(), and only applies a sapper to the other end of the teleporter if it returned false (this is done in CTFWeaponBuilder::PrimaryAttack). This means that sapping one end of a teleporter when the other end is plasma-disabled will result in only the close end of the teleporter being sapped. The HasSapper check in this case was meant to prevent double-sapping the other end of the teleporter; but because of the screwed-up semantics of HasSapper, it also prevents properly sapping both ends of a tele if the remote end is plasma-disabled.
When this situation occurs, it's impossible to remove the sapper if you're hitting the non-sapped end. Essentially, when you successfully apply damage to a sapper, the sapper will check if it's on a teleporter that has a matching partner, and if so, the sapper will propagate the damage it just took to the sapper on the other end (this happens in CObjectSapper::OnTakeDamage). Hitting the non-sapped end doesn't damage a sapper (because there isn't any sapper there), so the propagate-damage-to-the-other-tele's-sapper logic doesn't happen.
Also, it's not possible to remove sappers from a building when that building is plasma-disabled. This may or may not be intentional; I have no idea. But it manages to make sapper-spamming situations even more obnoxious to deal with than before.
Basically, this is an area of the game that is badly in need of some serious refactoring. What a mess.



![[1/3] Chase-Down-Stickies TFBot AI Mod (Jan 28 2016)
Part 1: I was working on a TFBot AI mod with the goal to make bots track down enemy stickybombs and then destroy them by shooting/hitting them. (Continue reading!)
Part 2: https://youtu.be/r6fwuVO38t8
Part 3: https://youtu.be/vkmh0rE3zLs
I believe this clip shows an early attempt that mostly just used the existing TFBot AlwaysAttack pop attribute and SeekAndDestroy action to make the bots hold down +mouse1 and chase down enemies, respectively. Then on top of that, I believe I wrote a little bit of custom code that altered the bots enemy determination code to make them consider stickybombs to be enemies rather than players. (Something like that... its been a long time, and this wasnt all documented super-well.)
The code for final(ish) version of this mod:
https://github.com/sigsegv-mvm/sigsegv-mvm/blob/dfe7f0d35edef3a8e040f266415751cd5d7b1355/src/mod/pop/extattr/targetstickies.cpp [1/3] Chase-Down-Stickies TFBot AI Mod (Jan 28 2016)](https://i.ytimg.com/vi/z2M5HtX-_p4/mqdefault.jpg)



