source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

[TF2] Fix bug where credits dropped in the robots' spawn become unobtainable in MVM

Open bradleycha opened this issue 11 months ago • 5 comments

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.

bradleycha avatar Feb 25 '25 05:02 bradleycha

#618 ?

catuhana avatar Feb 25 '25 07:02 catuhana

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

TheShermanTanker avatar Feb 26 '25 12:02 TheShermanTanker

#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.

bradleycha avatar Feb 26 '25 19:02 bradleycha

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.

megascatterbomb avatar Feb 26 '25 21:02 megascatterbomb

Replying to https://github.com/ValveSoftware/source-sdk-2013/pull/801#issuecomment-2686247054

In that case I retract my suggestion.

TheShermanTanker avatar Feb 27 '25 06:02 TheShermanTanker