ocraft / ocraft-s2client

StarCraft II Client - Java library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
MIT License
55 stars 15 forks source link

UpgradeData for terran mech armor upgrades map to the wrong research ability #22

Closed Ketroc closed 4 years ago

Ketroc commented 4 years ago

Upgrades.TERRAN_VEHICLE_AND_SHIP_ARMORS_LEVEL1 is currently mapped to RESEARCH_TERRAN_VEHICLE_AND_SHIP_PLATING_LEVEL1_V2 in UpgradeData.getAbility().

The correct ability is: RESEARCH_TERRAN_VEHICLE_AND_SHIP_PLATING_LEVEL1. ( no, "_V2" on the end)

The same applies for LEVEL2 and LEVEL3.

ocraft commented 4 years ago

I'm not sure that it's a bug, the mapping is based only on what the game server provides and the API itself has nothing to say in that matter. You can check all of the game mappings in \Documents\StarCraft II\stableid.json file and compare id to the name. Unfortunately, sometimes different game paths or game versions or maps have a different id for the same or similar upgrade/ability/unit because of some changes, and API can do nothing about that, only make a distinction with suffix, like _V2 in this example. There was a similar issue (but in the opposite direction) some time ago https://github.com/ocraft/ocraft-s2client/issues/8.