Raised This Month: $ Target: $400
 0% 

Solved Prevent round ending due to timer and remove timer with Orpheu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-06-2018 , 06:31   Prevent round ending due to timer and remove timer with Orpheu
Reply With Quote #1

How do I prevent round from ending when timer runs out of time? I was thinking of superceding SyncRoundTimer but it looks like it also deals with freezetime, it might cause problems.

Reference:
Code:
void CBasePlayer::SyncRoundTimer()
{
	float tmRemaining = 0;
	BOOL bFreezePeriod = g_pGameRules->IsFreezePeriod();

	if (g_pGameRules->IsMultiplayer())
	{
		tmRemaining = CSGameRules()->GetRoundRemainingTimeReal();

#ifdef REGAMEDLL_FIXES
		// hide timer HUD because it is useless.
		if (tmRemaining <= 0.0f && CSGameRules()->m_iRoundTime <= 0) {
			m_iHideHUD |= HIDEHUD_TIMER;
			return;
		}

		if (m_iHideHUD & HIDEHUD_TIMER)
		{
			m_iHideHUD &= ~HIDEHUD_TIMER;
			MESSAGE_BEGIN(MSG_ONE, gmsgShowTimer, nullptr, pev);
			MESSAGE_END();
		}
#endif
	}

	if (tmRemaining < 0)
		tmRemaining = 0;

	MESSAGE_BEGIN(MSG_ONE, gmsgRoundTime, nullptr, pev);
		WRITE_SHORT(int(tmRemaining));
	MESSAGE_END();

	if (!g_pGameRules->IsMultiplayer())
		return;

	if (bFreezePeriod && TheTutor && GetObserverMode() == OBS_NONE)
	{
		MESSAGE_BEGIN(MSG_ONE, gmsgBlinkAcct, nullptr, pev);
			WRITE_BYTE(MONEY_BLINK_AMOUNT);
		MESSAGE_END();
	}

	if (TheCareerTasks && CSGameRules()->IsCareer())
	{
		int remaining = 0;
		bool shouldCountDown = false;
		int fadeOutDelay = 0;

		if (tmRemaining != 0.0f)
		{
			remaining = TheCareerTasks->GetTaskTime() - (gpGlobals->time - CSGameRules()->m_fRoundStartTime);
		}

		if (remaining < 0)
			remaining = 0;

		if (bFreezePeriod)
			remaining = -1;

		if (TheCareerTasks->GetFinishedTaskTime())
			remaining = -TheCareerTasks->GetFinishedTaskTime();

		if (!bFreezePeriod && !TheCareerTasks->GetFinishedTaskTime())
		{
			shouldCountDown = true;
		}
		if (!bFreezePeriod)
		{
			if (TheCareerTasks->GetFinishedTaskTime() || (TheCareerTasks->GetTaskTime() <= TheCareerTasks->GetRoundElapsedTime()))
			{
				fadeOutDelay = 3;
			}
		}

		if (!TheCareerTasks->GetFinishedTaskTime() || TheCareerTasks->GetFinishedTaskRound() == CSGameRules()->m_iTotalRoundsPlayed)
		{
			MESSAGE_BEGIN(MSG_ONE, gmsgTaskTime, nullptr, pev);
				WRITE_SHORT(remaining);			// remaining of time, -1 the timer is disappears
				WRITE_BYTE(shouldCountDown);	// timer counts down
				WRITE_BYTE(fadeOutDelay); 		// fade in time, hide HUD timer after the expiration time
			MESSAGE_END();
		}
	}
}
Also, how do I get rid of the timer efficiently, with Orpheu? I know the way VEN does it by using HIDEHUD_TIMER, is there any other way?
__________________

Last edited by edon1337; 08-06-2018 at 13:51.
edon1337 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode