fixed anim bug
This commit is contained in:
1 parent
297bd7377f
commit
931236bec0
2 files changed
+50
-20
No files matched your search
@@ -1,5 +1,7 @@
|
||||
#include "LocationGameState.h"
|
||||
#include "game_server/InternalGameServer.h"
|
||||
#include <cstdlib>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
namespace {
|
||||
@@ -14,6 +16,10 @@ int fail(const char* message)
|
||||
|
||||
int main()
|
||||
{
|
||||
const std::filesystem::path repositoryRoot =
|
||||
std::filesystem::path(__FILE__).parent_path().parent_path().parent_path();
|
||||
std::filesystem::current_path(repositoryRoot);
|
||||
|
||||
FRG::LocationDefinition definition;
|
||||
definition.config.id = "test_location";
|
||||
|
||||
@@ -63,5 +69,22 @@ int main()
|
||||
|
||||
FRG::PlayerStateMap noPlayers;
|
||||
state.update(50, noPlayers, false);
|
||||
|
||||
FRG::CampaignConfig battleZone;
|
||||
battleZone.id = "battle_zone";
|
||||
battleZone.questsPath = "resources/config/quests_battle_zone.json";
|
||||
FRG::InternalGameServer server;
|
||||
server.startCampaign(battleZone, {}, false, true);
|
||||
const auto snapshot = server.snapshot();
|
||||
const auto bot = snapshot->players.find("battle_zone_test_bot");
|
||||
if (bot == snapshot->players.end())
|
||||
return fail("Battle Zone test bot was not created");
|
||||
const auto stand = static_cast<std::size_t>(FRG::AnimationState::STAND);
|
||||
const auto walk = static_cast<std::size_t>(FRG::AnimationState::WALK);
|
||||
if (bot->second.state.animationFrameCounts[stand] <= 1 ||
|
||||
bot->second.state.animationFrameCounts[walk] <= 1) {
|
||||
return fail("Battle Zone test bot animation metadata was not loaded");
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in new issue
Block a user