Update CaveGameWindow.cpp
Fix out of bounds read causing sigseg when nothing is entered.
This commit is contained in:
@@ -554,14 +554,16 @@ namespace CaveGame::ClientApp
|
||||
return copy;
|
||||
}
|
||||
|
||||
void CaveGameWindow::OnConsoleCommandInput(const std::string& command)
|
||||
{
|
||||
void CaveGameWindow::OnConsoleCommandInput(const std::string& command) {
|
||||
auto tokens = string_split(command, ' ');
|
||||
if (str_tolower(tokens[0]) == "worldedit") {
|
||||
tile_tool->Enable(!tile_tool->IsEnabled());
|
||||
if (tokens.empty())
|
||||
return;
|
||||
|
||||
// Commands that are single length argument.
|
||||
if (tokens.size() == 1) {
|
||||
if (str_tolower(tokens[0]) == "worldedit")
|
||||
tile_tool->Enable(!tile_tool->IsEnabled());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CaveGameWindow::create_console_window() {
|
||||
|
Reference in New Issue
Block a user