From 519681b5770e6d0001379ce1f1ea4a1cb5e3ba0b Mon Sep 17 00:00:00 2001 From: hank Date: Wed, 8 Jan 2025 22:55:01 -0600 Subject: [PATCH] Fix tower building exploit --- battlecode25/engine/game/robot_controller.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/battlecode25/engine/game/robot_controller.py b/battlecode25/engine/game/robot_controller.py index 303a4df..cbd534c 100644 --- a/battlecode25/engine/game/robot_controller.py +++ b/battlecode25/engine/game/robot_controller.py @@ -519,6 +519,7 @@ def remove_mark(self, loc: MapLocation) -> None: self.game.game_fb.add_unmark_action(loc) def assert_can_complete_tower_pattern(self, tower_type: UnitType, loc: MapLocation) -> None: + tower_type = tower_type.get_base_type() self.assert_is_robot_type(self.robot.type) self.assert_is_tower_type(tower_type) self.assert_can_act_location(loc, GameConstants.BUILD_TOWER_RADIUS_SQUARED) @@ -546,6 +547,7 @@ def can_complete_tower_pattern(self, tower_type: UnitType, loc: MapLocation) -> return False def complete_tower_pattern(self, tower_type: UnitType, loc: MapLocation) -> None: + tower_type = tower_type.get_base_type() self.assert_can_complete_tower_pattern(tower_type, loc) robot = self.game.spawn_robot(tower_type, loc, self.robot.team) self.game.game_fb.add_spawn_action(robot.id, loc, robot.team, robot.type)