Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freak_fortress_2: Fix unlocking capture point is not working #133

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

M60TM
Copy link
Contributor

@M60TM M60TM commented Nov 10, 2023

In detail:

  • tf_logic_arena's CapEnableDelay is only used for setting tf_gamerules_data's m_flCapturePointEnableTime before arena round start.
  • So, unlocking by alive check(ff2_game_capture_alive) actually unlock them if ff2_game_capture_time ConVar value was not setup(ex. 0.0)
  • But if ff2_game_capture_time ConVar has positive value, even if the number of people is appropriate, it will not be opened until the time is right.
void CTFGameRules::SetupOnStalemateStart( void )
{
...
		CArenaLogic *pArenaLogic = dynamic_cast< CArenaLogic * > (gEntList.FindEntityByClassname( NULL, "tf_logic_arena" ) );

		if ( pArenaLogic )
		{
			pArenaLogic->m_OnArenaRoundStart.FireOutput( pArenaLogic, pArenaLogic );

			if ( tf_arena_override_cap_enable_time.GetFloat() > 0 )
			{
				m_flCapturePointEnableTime = gpGlobals->curtime + tf_arena_override_cap_enable_time.GetFloat();
			}
			else
			{
				m_flCapturePointEnableTime = gpGlobals->curtime + pArenaLogic->m_flTimeToEnableCapPoint;
			}

			IGameEvent *event = gameeventmanager->CreateEvent( "arena_round_start" );
			if ( event )
			{
				gameeventmanager->FireEvent( event );
			}

			BroadcastSound( 255, "Announcer.AM_RoundStartRandom" );
		}
...
}

In detail:
- tf_logic_arena's `CapEnableDelay` is only used for setting tf_gamerules_data's `m_flCapturePointEnableTime` before arena round start.
- So, unlocking by alive check actually unlock them if time check ConVar value was not setup(ex. 0.0)
- But if time check ConVar has positive value, even if the number of people is appropriate, it will not be opened until the time is right.
@Batfoxkid Batfoxkid merged commit 88c5a6c into Batfoxkid:main Nov 15, 2023
1 of 2 checks passed
@M60TM M60TM deleted the check-time-and-alive branch November 12, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants