Skip to content

Commit

Permalink
Fix curses build
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Aug 6, 2024
1 parent bc167f3 commit 4ed41d8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/game/client/components/chillerbot/chathelper.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// ChillerDragon 2020 - chillerbot ux

#include <base/math.h>

#include <cinttypes>

#include <base/system.h>

#include <base/math.h>
#include <engine/shared/protocol.h>
#include <game/client/components/chat.h>
#include <game/client/components/chillerbot/chillerbotux.h>
Expand Down
17 changes: 12 additions & 5 deletions src/game/client/components/chillerbot/terminalui/history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,19 @@ bool CTerminalUI::LoadInputHistoryFile(int Type)
return false;
}

char *pLine;
const char *pLine;
int i = (INPUT_HISTORY_MAX_LEN - 1);
CLineReader *lr = new CLineReader();
lr->Init(File);
while((pLine = lr->Get()))
CLineReader LineReader = CLineReader();

if(!LineReader.OpenFile(File))
{
char aBuf[512];
str_format(aBuf, sizeof(aBuf), "failed to open '%s'", g_Config.m_ClPasswordFile);
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "chillerbot", aBuf);
return false;
}

while((pLine = LineReader.Get()))
{
if(pLine[0] == '\0')
continue;
Expand All @@ -89,7 +97,6 @@ bool CTerminalUI::LoadInputHistoryFile(int Type)
str_copy(m_aaInputHistory[Type][i], pLine, sizeof(m_aaInputHistory[Type][i]));
i--;
}
io_close(File);

// less than INPUT_HISTORY_MAX_LEN entries
// keeps the latest element still empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void CTerminalUI::RenderItems()
for(const CSnapEntities &Ent : m_pClient->SnapEntities())
{
const IClient::CSnapItem Item = Ent.m_Item;
const void *pData = Ent.m_pData;
const void *pData = Item.m_pData;
const CNetObj_EntityEx *pEntEx = Ent.m_pDataEx;

bool Inactive = false;
Expand Down

0 comments on commit 4ed41d8

Please sign in to comment.