Permalink
Browse files

Fix counting freezetime

Small fixes
  • Loading branch information...
s1lentq committed Dec 18, 2016
1 parent e50cfe3 commit bf6ef25f1d2f9db7667e26ac64ad9b64ec4b7af7
@@ -3425,6 +3425,8 @@ void EXT_FUNC ServerDeactivate()
{
g_pHostages->ServerDeactivate();
}
WeaponInfoReset();
}
void EXT_FUNC ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
@@ -2778,7 +2778,7 @@ void CHalfLifeMultiplay::OnRoundFreezeEnd()
}
// Reset the round time
m_fRoundStartTime = gpGlobals->time;
m_fRoundStartTimeReal = m_fRoundStartTime = gpGlobals->time;
// in seconds
m_iRoundTimeSecs = m_iRoundTime;
@@ -3414,7 +3414,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(InitHUD)(CBasePlayer *pl)
plr->SetScoreboardAttributes(pl);
if (i != pl->entindex())
if (pl->entindex() != i)
{
#ifndef REGAMEDLL_FIXES
if (plr->pev->flags == FL_DORMANT)
View
@@ -35,9 +35,6 @@ UNTESTED dynpitchvol_t rgdpvpreset[CDPVPRESETMAX] =
{ 27, 128, 90, 10, 10, 10, 1, 20, 40, 1, 5, 10, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
int gcallsentences = 0;
int fSentencesInit = FALSE;
TYPEDESCRIPTION CAmbientGeneric::m_SaveData[] =
{
DEFINE_FIELD(CAmbientGeneric, m_flAttenuation, FIELD_FLOAT),
@@ -63,18 +60,24 @@ TYPEDESCRIPTION CSpeaker::m_SaveData[] =
DEFINE_FIELD(CSpeaker, m_preset, FIELD_INTEGER),
};
int gcallsentences = 0;
BOOL fSentencesInit = FALSE;
int gcTextures = 0;
BOOL fTextureTypeInit = FALSE;
#endif // HOOK_GAMEDLL
// time delay until it's ok to speak: used so that two NPCs don't talk at once
float CTalkMonster::g_talkWaitTime = 0;
char gszallsentencenames[ CVOXFILESENTENCEMAX ][ CBSENTENCENAME_MAX ];
sentenceg rgsentenceg[ CSENTENCEG_MAX ];
char gszallsentencenames[CVOXFILESENTENCEMAX][CBSENTENCENAME_MAX];
sentenceg rgsentenceg[CSENTENCEG_MAX];
char grgszTextureName[ CTEXTURESMAX ][ CBTEXTURENAMEMAX ];
char grgchTextureType[ CTEXTURESMAX ];
int fTextureTypeInit;
int gcTextures;
// Used to detect the texture the player is standing on, map the
// texture name to a material type. Play footstep sound based on material type.
char grgszTextureName[CTEXTURESMAX][CBTEXTURENAMEMAX];
char grgchTextureType[CTEXTURESMAX];
LINK_ENTITY_TO_CLASS(ambient_generic, CAmbientGeneric, CCSAmbientGeneric);
IMPLEMENT_SAVERESTORE(CAmbientGeneric, CBaseEntity);
@@ -1473,6 +1476,9 @@ NOXREF void EMIT_GROUPNAME_SUIT(edict_t *entity, const char *groupname)
}
}
// open materials.txt, get size, alloc space,
// save in array. Only works first time called,
// ignored on subsequent calls.
char *memfgets(byte *pMemFile, int fileSize, int &filePos, char *pBuffer, int bufferSize)
{
// Bullet-proofing
@@ -352,7 +352,6 @@ void W_Precache()
Q_memset(IMPL_CLASS(CBasePlayerItem, AmmoInfoArray), 0, sizeof(IMPL_CLASS(CBasePlayerItem, AmmoInfoArray)));
giAmmoIndex = 0;
WeaponInfoReset();
// custom items...
@@ -5721,6 +5721,7 @@ AddressRef g_DataRefs[] =
{ 0x01E23AA8, "TutorIdentifierList", (size_t)&pTutorIdentifierList },
{ 0x01E23678, "_ZL19g_TutorStateStrings", (size_t)&pg_TutorStateStrings },
{ 0x01E61E4C, "WorldGraph", (size_t)&pWorldGraph },
//{ 0x01E61E5C, "_ZN12CTalkMonster14g_talkWaitTimeE", mfunc_ptr_cast(&CTalkMonster::pg_talkWaitTime) },
{ 0x01E61B98, "g_pGameRules", (size_t)&pg_pGameRules },
{ 0x01E62560, "g_pMPGameRules", (size_t)&pg_pMPGameRules },
{ 0x01E61E70, "_ZL12mp_com_token", (size_t)&pmp_com_token },
@@ -1377,6 +1377,9 @@ int CHalfLifeRules::PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarge
BOOL CHalfLifeRules::FAllowMonsters() { return FAllowMonsters_(); }
// sound
int gcTextures;
BOOL fTextureTypeInit;
void CAmbientGeneric::Spawn() { Spawn_(); }
void CAmbientGeneric::Precache() { Precache_(); }
void CAmbientGeneric::Restart() { Restart_(); }
@@ -862,7 +862,7 @@ extern DLL_FUNCTIONS gFunctionTable;
extern NEW_DLL_FUNCTIONS gNewDLLFunctions;
extern char grgszTextureName[1024][17];
extern char grgchTextureType[1024];
extern int fTextureTypeInit;
extern BOOL fTextureTypeInit;
extern struct sentenceg rgsentenceg[200];
extern int fSentencesInit;
extern int gcallsentences;
@@ -74,7 +74,7 @@ void PM_InitTextureTypes()
char buffer[512];
int i, j;
byte *pMemFile;
int fileSize, filePos;
int fileSize, filePos = 0;
static bool bTextureTypeInit = false;
if (bTextureTypeInit)
@@ -86,15 +86,12 @@ void PM_InitTextureTypes()
pm_gcTextures = 0;
Q_memset(buffer, 0, sizeof(buffer));
fileSize = pmove->COM_FileSize("sound/materials.txt");
pMemFile = pmove->COM_LoadFile("sound/materials.txt", 5, NULL);
pMemFile = pmove->COM_LoadFile("sound/materials.txt", 5, &fileSize);
if (!pMemFile)
return;
filePos = 0;
// for each line in the file...
while (pmove->memfgets(pMemFile, fileSize, &filePos, buffer, sizeof(buffer) - 1) != NULL && (pm_gcTextures < CTEXTURESMAX))
while (pmove->memfgets(pMemFile, fileSize, &filePos, buffer, sizeof(buffer) - 1) && (pm_gcTextures < CTEXTURESMAX))
{
// skip whitespace
i = 0;
@@ -5,4 +5,6 @@ void Regamedll_Game_Init()
g_bIsCzeroGame = UTIL_IsGame("czero");
g_bAllowedCSBot = UTIL_AreBotsAllowed(); // determine whether bots can be used or not
g_bHostageImprov = UTIL_AreHostagesImprov(); // determine whether hostage improv can be used or not
WeaponInfoReset();
}

0 comments on commit bf6ef25

Please sign in to comment.