[TF2] gameplay: automatically collect MvM money in respawn room
MvM money is automatically collected in various cases where its position is unfair for players to collect themselves.
There is a case where robots can drop money in their own spawn, which can prove hard or impossible to acquire, so add an additional check for money that is in a spawn room, just like it is already done for trigger_hurt.
In my opinion it would be cleaner to expand the above check to also check for the nav flags instead of iterating through all the respawn rooms, can do something like this:
CTFNavArea *area = (CTFNavArea *)TheNavMesh->GetNavArea( GetAbsOrigin() );
if ( !area || area->HasAttributeTF(TF_NAV_SPAWN_ROOM_BLUE | TF_NAV_SPAWN_ROOM_RED) )
{
TFGameRules()->DistributeCurrencyAmount( m_nAmount );
m_bTouched = true;
UTIL_Remove( this );
return;
}
Sure, I just thought it was appropriate since trigger_hurt has the same check.
Hi, there seems to be a regression with this; many custom MvM maps opt to group the func_respawnroom brushes into a single entity, causing them to have a massive bounding box spanning the entire map. This is most noticable on Hoovydam.
Ack, that's no good! My apologies. The solution @Mikusch proposed would likely be suitable for fixing this.