Checking if a unit is being removed

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).

Found it in the json documents

1 Like

For anyone who finds this question in the future:

The docs ElliotBak3r looked at are here
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.

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