- G_AddPlayer now contains CL_ClearPlayer, G_DestroyParty, and playeringame set
- Instead of a nasty, complicated block in P_SpawnPlayer, externalise it into G_SpectatePlayerOnJoin
- All mid-game human player-to-spectator transitions are handled by P_SetPlayerSpectator, instead of lots of `spectator = true` and associated boilerplate
- Simplifies Got_Teamchange MASSIVELY
- Of course this is helped by also stripping back team change
- This is called by P_KillPlayer, too
- P_KillPlayer no longer eats DMG_SPECTATOR when lightsnaking or exiting
- G_GametypeHasSpectators condition tidied
- No need to call CV_RegisterVar
- Cvar definitions live in only one file, easier to locate
- Organized into sections -- netvars, cheats, etc.
- Use builder pattern to initialize cvars
- Still need to extern if you want to read the cvar value
- Skin_OnChange
- Now always checks for cheats for any machine-local player skin change in non-netgame, non-K_CanChangeRules contexts
- Previously applied only to consoleplayer in Time Trial
- Color_OnChange
- Fixes straight up incorrect condition that prevented honest players from changing color mid-game via the developer console
- Save retry condition in G_BeginLevelExit
- Apply condition in G_FinishExitLevel
Preparation for ACS level end scripts, since the exit
condition will need be known when the countdown starts,
not when it ends (that'd be too late to do anything in the
level).
TODO: This should be available as a debugging option at
release, since it would be useful for addon authors.
I don't want to make more cvars, those are getting
cluttered and should maybe be coalesced into a single
debugging option.
None of the following can be combined together, and Grand Prix is still the default with no parameter from the menus.
- `-server`
- Starts a server
- `-match`
- Starts a Match (Race) round
- `-skill`
- Already existed, but can now only be used for GP
Also guarantees the main menu wil be closed, which wasn't previously guaranteed.
- Re-entry SHOULDN'T get stuck nonzero on first join for a given node
- Set to 0 for all players on level start
- Set to 0 for all players on level end
- DEFINITELY never intentionally set on join with teamchange finalisation
- This basically just prevents people from spamming New Challenger after hopping out mid-session, since the previous version, in addition to being buggy, was a little annoying.
- New Challenger no longer happens on tic 0 of mapload
- Handles any late, pending PF_PF_WANTSTOJOINs without threat of reset in P_PostLoadLevel
- Grand Prix (& backup) and Match Race bot initialisation
- Fixes rival selection
- P_InitPlayers
- Has to be after bot init
- Beginning of demo recording
- Grand Prix and Match Race replays appear to both function far better, and equivalently to boot.
- A desync in "RNG seed 24" is reported. This is PR_BOTS. This is the only notable desync I can see!
- ACS_LoadLevelScripts
- I'm not ironclad sold on this being the forever home, but it's also a not-from-netsave thing, and barring external input I could see some scripts being dependent on a finalised player list.
The linedef's behaviour was broken horribly by long map names, and it's not worth the effort to fix it for the following reasons.
- It was considered a security vulnerability to have free access to the console when it was written.
- The game literally had a cvar to disable running console scripts. That's "I am willingly distributing ActiveX Word Documents in 2023" levels of foolhardery.
- Anything GOOD it can do, both Lua and ACS can do better.
A much more focused replacement for Hornmod, specc'd out by Tyron and Oni working together and implemented by the author of this commit because it's pretty funny.
- Followers have `hornsound` in their SOC configuration.
- The default sound for all followers without a provided one is sfx_horn00.
- They'll play this sound if you use lookback with one following you, and there's nearby players to get the player looking all the way around.
- Only the players who are successfully considered for lookback will hear it.
- Has a v1-like visual with less randomisation, but still netsynced.
- Also controlled by the cvar `taunthorns`, which, like `tauntvoices`, takes "Tasteful" (default), "Meme", and "Off".
TODO: make the condition for horn a little delayed, so you have to hold lookback for a little bit.
- Only calls callback if you're the server (and not demo.playback, forward thinking for stored xcmd netreplays)
- G_GamestateUsesExitLevel() for homogenising the conditions that permit XD_EXITLEVEL to be dispatched and recieved
- SendNameAndColor was completely out of order for some reason
- SendNameAndColor was sending cvar value instead of the send value. The value for sending. The value chosen specifically for sending, the send value.
- Color_OnChange was just broken in the SKINCOLOR_NONE case