Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
David Carrasquet committed Dec 29, 2019
2 parents 8141d57 + 35208e1 commit 2d6cce8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Motor2D/j1ConsoleM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ bool j1ConsoleM::ManageCommand(const char* command)
commandBuffer = command;

//We check if it has the number adequate of arguments
int wordNum = commandBuffer.Find(" ") + 1;
if (wordNum < commandFound->min_arg || wordNum > commandFound->max_arg)
break;
int wordNum = commandBuffer.Find(" ") + 1;
if (wordNum < commandFound->min_arg || wordNum > commandFound->max_arg)
break;

//If all the checks were positive, we execute the command
switch (commandFound->function)
{
case UIFunction::FNC_LOG:
commandBuffer.Cut(0, commandBuffer.FindFirst(" ")+1);
commandBuffer.Cut(0, commandBuffer.FindFirst(" ") + 1);
commandFound->callback->OnGui(UIEventType::EVENT_CONSOLE, commandFound->function, nullptr, commandBuffer.GetString());
break;
case UIFunction::FNC_GODMODE:
Expand All @@ -101,11 +101,10 @@ bool j1ConsoleM::ManageCommand(const char* command)
break;

case UIFunction::FNC_LOADMAP:
commandBuffer.Cut(0, commandBuffer.FindFirst(" ")+1);
commandFound->callback->OnGui(UIEventType::EVENT_CONSOLE, commandFound->function,nullptr, commandBuffer.GetString());
commandBuffer.Cut(0, commandBuffer.FindFirst(" ") + 1);
commandFound->callback->OnGui(UIEventType::EVENT_CONSOLE, commandFound->function, nullptr, commandBuffer.GetString());
break;


case UIFunction::FNC_FPS:
commandBuffer.Cut(0, commandBuffer.FindFirst(" ") + 1);
commandFound->callback->OnGui(UIEventType::EVENT_CONSOLE, commandFound->function, nullptr, commandBuffer.GetString());
Expand Down Expand Up @@ -145,7 +144,7 @@ void j1ConsoleM::OnGui(UIEventType type, UIFunction func, j1UIelement* userPoint
CommandNum++;
}
}
break;
break;
}
}
}

0 comments on commit 2d6cce8

Please sign in to comment.