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

[TF2] Treat being in background map as not in-game

Open horiuchii opened this issue 5 months ago • 4 comments

Description

This PR makes it so that being in a Background Map doesn't count as being in-game for the main menu. This means the call vote, mute players, request coach and report players buttons won't appear and the quit button will be there instead be the disconnect button.

The player can still type disconnect in console to leave the background map as usual.

horiuchii avatar Jul 21 '25 03:07 horiuchii

This addresses the issue by adding conditions to where the value is used. Should the condition be put into the IsInGame function instead?

henke37 avatar Jul 25 '25 12:07 henke37

https://github.com/ValveSoftware/source-sdk-2013/pull/1440#issuecomment-3117658790

This isn't possible as we don't have access to whatever file it's defined in.

horiuchii avatar Jul 25 '25 14:07 horiuchii

This addresses the issue by adding conditions to where the value is used. Should the condition be put into the IsInGame function instead?

IsInGame() from IVEngineClient only exists as a wrapper for CClientState::IsActive() in the engine dll. It does not do any other additional checks behind the scenes.

RileyKun avatar Aug 09 '25 17:08 RileyKun

Can also add to CTFDemoSupport::Update on the first line.

Also this doesn't hide the background, I suggest touching up the file to change some bIsGame checks to also include a check for bBackgroundLevel, while keep bIsGame = engine->IsInGame() && !bBackgroundLevel

mastercoms avatar Dec 04 '25 21:12 mastercoms