Fix troop exploit (#1556)

## Description:
Fixes #1554 (short description)

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA aggreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:
dovg
This commit is contained in:
tnhnblgl
2025-07-24 21:03:40 +03:00
committed by GitHub
parent f958f0f473
commit 8dedb15ce1
+2 -2
View File
@@ -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(),
});