Skip to content

Commit

Permalink
Console: Add 'fightmoves' command, which dumps all C_FightAI instance…
Browse files Browse the repository at this point in the history
…s found in FIGHT.D
  • Loading branch information
ataulien committed Aug 18, 2018
1 parent f9930db commit b0055f9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/target/REGoth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <content/AnimationAllocator.h>
#include <content/StaticMeshAllocator.h>
#include <content/SkeletalMeshAllocator.h>
#include <logic/FightAI.h>

using json = nlohmann::json;

Expand Down Expand Up @@ -185,6 +186,29 @@ void REGoth::initConsole()
return "Playing keyed animation";
});

console.registerCommand("fightmoves", [this](const std::vector<std::string>& args) -> std::string {
Logic::FightAI ai(m_pEngine->getMainWorld().get());

auto instanceNames = ai.dumpAllMoveInstancesToLog();

std::string out;

if (instanceNames.empty())
{
out = "No instances of class C_FightAI found!";
}
else
{
out = "Instances of class C_FightAI:";

for (auto name : instanceNames)
{
out += std::string(" - ") + name + "\n";
}
}

return out;
});

console.registerCommand("stats", [](const std::vector<std::string>& args) -> std::string {
static bool s_Stats = false;
Expand Down

0 comments on commit b0055f9

Please sign in to comment.