[TF2] Fix bug where credits dropped in the robots' spawn become unobtainable in MVM
In rare circumstances, a bot killed just outside of its spawn may drop credits within the robot spawn. This can lead to the credits becoming unobtainable, sometimes even with Scout's money magnet mechanic.
This fix checks if the credits come to rest within the robots' spawn, and if they do, automatically collects them. I also did some minor refactoring of CCurrencyPack::ComeToRest(), as I feel that the function is a bit of a mess.
#618 ?
Since we're doing this, can we remove robot spawn invulnerability? The comment on that states that the robots only get free uber in robot spawn to prevent money from being dropped in the spawn where players cannot pick it up. With this change, that functionality is now obsolete. Look at tf_bot_behavior.cpp and tf_populators.cpp for more details
#618 ?
I wasn't aware the that PR when I made this code, thanks for letting me know.
While that PR does collect money in spawn, this code includes a few additional checks to ensure only active spawns for the robots will trigger the fail-safe. I do this out of fear for weird edge-cases where bots could die just outside of red's spawn, which would trigger the fail-safe and collect money, even though it's perfectly reachable.
Since we're doing this, can we remove robot spawn invulnerability? The comment on that states that the robots only get free uber in robot spawn to prevent money from being dropped in the spawn where players cannot pick it up. With this change, that functionality is now obsolete. Look at tf_bot_behavior.cpp and tf_populators.cpp for more details
This is a bad idea. The bot spawns are clearly not intended to be combat zones. Most classes would not even be able to deal damage to bots in that area.
Your suggestion would also open up the possibility of the bomb being dropped in inaccessible areas e.g. on Mannworks, if the bomb is dropped on one side and the next wave of bots spawn on the other side, then it's impossible to lose as those bots cannot get back into their spawn once they drop down.
Replying to https://github.com/ValveSoftware/source-sdk-2013/pull/801#issuecomment-2686247054
In that case I retract my suggestion.