mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Use std::vector<std::string> instead of array
This commit is contained in:
parent
0f097a0490
commit
d3eb9d6fe7
|
@ -1770,15 +1770,15 @@ void CGameContext::CensorMessage(char *pCensoredMessage, const char *pMessage, i
|
||||||
{
|
{
|
||||||
str_copy(pCensoredMessage, pMessage, Size);
|
str_copy(pCensoredMessage, pMessage, Size);
|
||||||
|
|
||||||
for(int i = 0; i < m_aCensorlist.size(); i++)
|
for(auto &Item : m_vCensorlist)
|
||||||
{
|
{
|
||||||
char *pCurLoc = pCensoredMessage;
|
char *pCurLoc = pCensoredMessage;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
pCurLoc = (char *)str_utf8_find_nocase(pCurLoc, m_aCensorlist[i].c_str());
|
pCurLoc = (char *)str_utf8_find_nocase(pCurLoc, Item.c_str());
|
||||||
if(pCurLoc)
|
if(pCurLoc)
|
||||||
{
|
{
|
||||||
memset(pCurLoc, '*', m_aCensorlist[i].length());
|
memset(pCurLoc, '*', Item.length());
|
||||||
pCurLoc++;
|
pCurLoc++;
|
||||||
}
|
}
|
||||||
} while(pCurLoc);
|
} while(pCurLoc);
|
||||||
|
@ -3304,7 +3304,7 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/)
|
||||||
char *pLine;
|
char *pLine;
|
||||||
while((pLine = LineReader.Get()))
|
while((pLine = LineReader.Get()))
|
||||||
{
|
{
|
||||||
m_aCensorlist.add(pLine);
|
m_vCensorlist.emplace_back(pLine);
|
||||||
}
|
}
|
||||||
io_close(File);
|
io_close(File);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
#include <game/mapbugs.h>
|
#include <game/mapbugs.h>
|
||||||
#include <game/voting.h>
|
#include <game/voting.h>
|
||||||
|
|
||||||
#include <base/tl/array.h>
|
|
||||||
|
|
||||||
#include "eventhandler.h"
|
#include "eventhandler.h"
|
||||||
//#include "gamecontroller.h"
|
//#include "gamecontroller.h"
|
||||||
#include "game/generated/protocol.h"
|
#include "game/generated/protocol.h"
|
||||||
|
@ -74,7 +72,7 @@ class CGameContext : public IGameServer
|
||||||
CNetObjHandler m_NetObjHandler;
|
CNetObjHandler m_NetObjHandler;
|
||||||
CTuningParams m_Tuning;
|
CTuningParams m_Tuning;
|
||||||
CTuningParams m_aTuningList[NUM_TUNEZONES];
|
CTuningParams m_aTuningList[NUM_TUNEZONES];
|
||||||
array<std::string> m_aCensorlist;
|
std::vector<std::string> m_vCensorlist;
|
||||||
|
|
||||||
bool m_TeeHistorianActive;
|
bool m_TeeHistorianActive;
|
||||||
CTeeHistorian m_TeeHistorian;
|
CTeeHistorian m_TeeHistorian;
|
||||||
|
|
Loading…
Reference in a new issue