Skip to content

Commit

Permalink
Fix TeleportReason not being serialized correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
timoschwarzer committed Nov 20, 2024
1 parent 986f94b commit 30f8fd8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions projects/Randomizer/stats/game_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,6 @@ namespace randomizer::timing {
Portal,
};

NLOHMANN_JSON_SERIALIZE_ENUM(
TeleportReason,
{
{TeleportReason::Unknown, "Unknown" },
{TeleportReason::Teleporter, "Teleporter"},
{TeleportReason::Death, "Death" },
{TeleportReason::Door, "Door" },
{TeleportReason::Portal, "Portal" },
}
);

struct Teleport {
float from_x = 0.f;
float from_y = 0.f;
Expand Down Expand Up @@ -231,4 +220,15 @@ namespace randomizer::timing {

void json_deserialize(nlohmann::json& j) override;
};

NLOHMANN_JSON_SERIALIZE_ENUM(
SaveFileGameStats::TeleportReason,
{
{SaveFileGameStats::TeleportReason::Unknown, "Unknown" },
{SaveFileGameStats::TeleportReason::Teleporter, "Teleporter"},
{SaveFileGameStats::TeleportReason::Death, "Death" },
{SaveFileGameStats::TeleportReason::Door, "Door" },
{SaveFileGameStats::TeleportReason::Portal, "Portal" },
}
);
} // namespace randomizer::timing

0 comments on commit 30f8fd8

Please sign in to comment.