Checking if a unit is being removed

Checking if a unit is being removed
0

#1

Is there a function like “game_state.is_removed()” to tell if a firewall is being removed since you are able to tell if you play by hand? Or is there a work around such as the unit will have zero health but is still there on the map?

This can be usefull to defend against corner attacks (cough ping cannons cough).

edit:
Found it in the json documents


#2

For anyone who finds this question in the future:

The docs ElliotBak3r looked at are here https://docs.c1games.com/json-docs.html.
If you are looking at the frame data directly, you are looking at p1Units, p2Units and Unitstats on that page.

Language specific alternative methods:
In python algos, gameunits have an attribute called ‘pendingRemoval’ which is True if they are pending removal. You can access the Tower’s gameunit object using the gamemap. https://docs.c1games.com/python/gamelib.html#module-gamelib.game_map

In Java and Rust algo, I believe a new Unit is created at the same location as the tower called a ‘Remove Unit’.