diff --git a/src/core/Schemas.ts b/src/core/Schemas.ts index f439ea5fa..b65fc8864 100644 --- a/src/core/Schemas.ts +++ b/src/core/Schemas.ts @@ -246,7 +246,7 @@ export const AllianceExtensionIntentSchema = BaseIntentSchema.extend({ export const AttackIntentSchema = BaseIntentSchema.extend({ type: z.literal("attack"), targetID: ID.nullable(), - troops: z.number().nullable(), + troops: z.number().nonnegative().nullable(), }); export const SpawnIntentSchema = BaseIntentSchema.extend({ @@ -261,7 +261,7 @@ export const SpawnIntentSchema = BaseIntentSchema.extend({ export const BoatAttackIntentSchema = BaseIntentSchema.extend({ type: z.literal("boat"), targetID: ID.nullable(), - troops: z.number(), + troops: z.number().nonnegative(), dst: z.number(), src: z.number().nullable(), });