mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 23:58:06 +03:00
Bugfix: Wrong counting of GetMapCount and typo in CHalfLifeMultiplay::ProcessMapVote
This commit is contained in:
parent
c406141e47
commit
6115723666
@ -4483,22 +4483,22 @@ void CHalfLifeMultiplay::ResetAllMapVotes()
|
|||||||
|
|
||||||
int GetMapCount()
|
int GetMapCount()
|
||||||
{
|
{
|
||||||
static mapcycle_t mapcycle2;
|
static mapcycle_t mapcycle;
|
||||||
char *mapcfile = (char *)CVAR_GET_STRING("mapcyclefile");
|
char *mapcfile = (char *)CVAR_GET_STRING("mapcyclefile");
|
||||||
|
|
||||||
DestroyMapCycle(&mapcycle2);
|
DestroyMapCycle(&mapcycle);
|
||||||
ReloadMapCycleFile(mapcfile, &mapcycle2);
|
ReloadMapCycleFile(mapcfile, &mapcycle);
|
||||||
|
|
||||||
int iCount = 0, iDone = 0;
|
int nCount = 0;
|
||||||
for (mapcycle_item_s *item = mapcycle2.next_item; item != NULL && iDone != 1; item = item->next)
|
auto item = mapcycle.next_item;
|
||||||
|
|
||||||
|
do
|
||||||
{
|
{
|
||||||
if (item == mapcycle2.next_item)
|
++nCount;
|
||||||
iDone = 1;
|
item = item->next;
|
||||||
|
} while (item != mapcycle.next_item);
|
||||||
|
|
||||||
++iCount;
|
return nCount;
|
||||||
}
|
|
||||||
|
|
||||||
return iCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHalfLifeMultiplay::DisplayMaps(CBasePlayer *player, int iVote)
|
void CHalfLifeMultiplay::DisplayMaps(CBasePlayer *player, int iVote)
|
||||||
@ -4561,7 +4561,6 @@ void CHalfLifeMultiplay::DisplayMaps(CBasePlayer *player, int iVote)
|
|||||||
void CHalfLifeMultiplay::ProcessMapVote(CBasePlayer *player, int iVote)
|
void CHalfLifeMultiplay::ProcessMapVote(CBasePlayer *player, int iVote)
|
||||||
{
|
{
|
||||||
CBaseEntity *pTempEntity = NULL;
|
CBaseEntity *pTempEntity = NULL;
|
||||||
|
|
||||||
int iValidVotes = 0, iNumPlayers = 0;
|
int iValidVotes = 0, iNumPlayers = 0;
|
||||||
|
|
||||||
while ((pTempEntity = UTIL_FindEntityByClassname(pTempEntity, "player")) != NULL)
|
while ((pTempEntity = UTIL_FindEntityByClassname(pTempEntity, "player")) != NULL)
|
||||||
@ -4575,7 +4574,7 @@ void CHalfLifeMultiplay::ProcessMapVote(CBasePlayer *player, int iVote)
|
|||||||
{
|
{
|
||||||
++iNumPlayers;
|
++iNumPlayers;
|
||||||
|
|
||||||
if (pTempPlayer->m_iMapVote = iVote)
|
if (pTempPlayer->m_iMapVote == iVote)
|
||||||
++iValidVotes;
|
++iValidVotes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user