NeotokyoRebuild / neo

NEOTOKYO Rebuild - Source SDK 2013 mod of NEOTOKYO
Other
11 stars 9 forks source link

Fix dead player observing & bot team join logic parity #359

Closed Rainyan closed 2 weeks ago

Rainyan commented 1 month ago

Fix #336

If spectating a player who has died, and it's been >=DEATH_ANIMATION_TIME since their death, look up the next valid target and switch to them.


Also sneaking in a bot_next_team server cvar, because it was useful for testing this. Set bot_next_team to a team index to force the next bot created by bot_add to join that specific team. Default value is -1, which instead makes the bot join the player team with less players. There's also -2, which makes bot join a player team completely at random. Anecdotally, this actually fixes a parity issue with bots - before this change, they were joining player teams completely randomly, but OG NT bots follow the -1 value behaviour (which is the default now).


This PR duplicates some of the base CBasePlayer methods for client side access, to be called from the C_NEO_Player::Calc<...>View overrides. The client's also now receiving the m_flDeathTime prop for calculating the death deltatime client side for observing purposes.


Steps to repro:

What happens before this patch:

What happens after this patch: