Fix: bug with mp_buytime in reset always set to 0 because of cast to const int.

This commit is contained in:
s1lentq 2016-01-19 21:27:10 +06:00
parent 6f51a65ae9
commit 08798e0e14
2 changed files with 7 additions and 5 deletions

View File

@ -4236,12 +4236,12 @@ bool CBasePlayer::CanPlayerBuy(bool display)
return false;
}
int buyTime = (int)(CVAR_GET_FLOAT("mp_buytime") * 60);
int buyTime = (int)(CVAR_GET_FLOAT("mp_buytime") * 60.0f);
if (buyTime < 15)
if (buyTime < MIN_BUY_TIME)
{
buyTime = 15;
CVAR_SET_FLOAT("mp_buytime", 1 / (60 / 15));
buyTime = MIN_BUY_TIME;
CVAR_SET_FLOAT("mp_buytime", (MIN_BUY_TIME / 60.0f));
}
if (gpGlobals->time - mp->m_fRoundCount > buyTime)

View File

@ -34,7 +34,9 @@
#include "hintmessage.h"
#define MAX_BUFFER_MENU 175//?
#define MIN_BUY_TIME 15 // the minimum threshold values for cvar mp_buytime 15 sec's
#define MAX_BUFFER_MENU 175
#define MAX_BUFFER_MENU_BRIEFING 50
#define MAX_PLAYER_NAME_LENGTH 32