Blizzard / s2client-api

StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
MIT License
1.66k stars 282 forks source link

is_alive field of Spine Crawler stays true for the in-built AI #227

Open Archiatrus opened 6 years ago

Archiatrus commented 6 years ago

Hi,

when playing games against CreateComputer(sc2::Race::Zerg, sc2::Difficulty::CheatInsane) and killing a spinecrawler, then the is_alive field stays true. I could not reproduce this with setting my own bot to Zerg, building a Spinecrawler and killing it. In this case the is_alive field behaved like expected. So it only should be a minor issue. I am not sure what happens if the second player is a custom bot. Attached is the overview of the unit object showing 0 health but is_alive still true.

Regards

spinecrawler

KevinCalderone commented 6 years ago

That field may not be reliable for enemy units. From glancing at the code we seem to only update that field for ally units or enemy units that die while within your vision.

Was the enemy unit in vision when it died?

Archiatrus commented 6 years ago

The unit was visible (see display_type). The Spine Crawler is the only unit with this behavior I have encountered.