feat: cu tank icons

This commit is contained in:
tresabhi committed 2026-05-05 17:08:43 -05:00
1 parent ba4e6dfd68
commit c674da29d5
3 files changed
+9 -3

No files matched your search

@@ -1,6 +1,7 @@
import { Nation } from "@protos/game/proto/legacy/blitz_static_tank_component";
import type { APIContext, GetStaticPaths } from "astro";
import { game } from "../../../../core/game/game";
import { clientUnmountedResponse } from "../../../../core/api/responses";
import { clientUnmounted, game } from "../../../../core/game/game";
export const getStaticPaths = (async () => {
return Object.values(Nation)
@@ -12,9 +13,11 @@ export const getStaticPaths = (async () => {
* Even Noah can't save these animals.
*/
export async function GET({ params }: APIContext<never, { id: string }>) {
if (clientUnmounted) return clientUnmountedResponse;
const enumName = Nation[Number(params.id)];
const nationName = enumName.replace("NATION_", "").toLowerCase();
const flag = game.flag(nationName);
const flag = game!.flag(nationName);
return new Response(new Uint8Array(flag));
}