Compare commits
2 Commits
1.10-fork
...
bugfix-cst
Author | SHA1 | Date | |
---|---|---|---|
|
bf580a7134 | ||
|
2fdb11ef1e |
@ -51,6 +51,7 @@ IGameConfig *g_pGameConf = NULL;
|
||||
IGameEventManager2 *gameevents = NULL;
|
||||
bool hooked_everything = false;
|
||||
int g_msgHintText = -1;
|
||||
CGlobalVars *gpGlobals;
|
||||
|
||||
SMEXT_LINK(&g_CStrike);
|
||||
|
||||
@ -107,6 +108,7 @@ bool CStrike::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
|
||||
{
|
||||
GET_V_IFACE_CURRENT(GetEngineFactory, gameevents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
|
||||
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
||||
gpGlobals = ismm->GetCGlobals();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -166,6 +166,7 @@ private:
|
||||
extern IBinTools *g_pBinTools;
|
||||
extern IGameConfig *g_pGameConf;
|
||||
extern ISDKTools *g_pSDKTools;
|
||||
extern CGlobalVars *gpGlobals;
|
||||
extern int g_msgHintText;
|
||||
extern bool g_pIgnoreTerminateDetour;
|
||||
extern bool g_pIgnoreCSWeaponDropDetour;
|
||||
|
@ -58,7 +58,19 @@ void TimeLeftEvents::FireGameEvent(IGameEvent *event)
|
||||
if (get_new_timeleft_offset || !round_end_found)
|
||||
{
|
||||
get_new_timeleft_offset = false;
|
||||
timersys->NotifyOfGameStart();
|
||||
|
||||
float flGameStartTime = gpGlobals->curtime;
|
||||
uintptr_t gamerules = (uintptr_t)g_pSDKTools->GetGameRules();
|
||||
if (gamerules)
|
||||
{
|
||||
sm_sendprop_info_t info;
|
||||
if (gamehelpers->FindSendPropInfo("CCSGameRulesProxy", "m_flGameStartTime", &info))
|
||||
{
|
||||
flGameStartTime = *(float *)(gamerules + info.actual_offset);
|
||||
}
|
||||
}
|
||||
|
||||
timersys->NotifyOfGameStart(flGameStartTime - gpGlobals->curtime);
|
||||
timersys->MapTimeLeftChanged();
|
||||
}
|
||||
round_end_found = false;
|
||||
|
Loading…
Reference in New Issue
Block a user