Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Commit 5c962b7

Browse files
gridmaster improvements
1 parent 4910e80 commit 5c962b7

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

bot/gridmaster/src/main.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,25 @@ void ft_on_object_ticked(t_obj *unit, unsigned long tick)
7575
t_obj * nearestResource = ft_get_resource_nearest(unit->pos);
7676
if (nearestResource)
7777
move_unit_to(unit, nearestResource->pos);
78-
else
79-
move_unit_to(unit, ft_get_core_opponent()->pos);
78+
// else
79+
// move_unit_to(unit, ft_get_core_opponent()->pos);
8080
}
8181
else if (typeId == UNIT_CARRIER)
8282
{
8383
unsigned int balance = unit->s_unit.balance;
84-
if (balance > 0)
84+
t_obj * nearestMoney = ft_get_money_nearest(unit->pos);
85+
if (balance > 500 || !nearestMoney)
8586
{
8687
move_unit_to(unit, ft_get_core_own()->pos);
87-
core_action_transferMoney(unit, ft_get_core_own()->pos, balance);
88+
if (balance > 0)
89+
core_action_transferMoney(unit, ft_get_core_own()->pos, balance);
8890
}
8991
else
9092
{
91-
t_obj * nearestMoney = ft_get_money_nearest(unit->pos);
9293
if (nearestMoney)
9394
move_unit_to(unit, nearestMoney->pos);
94-
else
95-
move_unit_to(unit, ft_get_core_opponent()->pos);
95+
// else
96+
// move_unit_to(unit, ft_get_core_opponent()->pos);
9697
}
9798
}
9899
}

0 commit comments

Comments
 (0)