Skip to content

Commit

Permalink
Merge pull request #70 from leamare/master
Browse files Browse the repository at this point in the history
add hero variant to entries along with hero_ids
  • Loading branch information
howardchung committed Jun 19, 2024
2 parents c7b604e + fa9e9d7 commit c621405
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/opendota/Parse.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public class Entry {
public Float z;
public Float stuns;
public Integer hero_id;
public Integer variant;
public transient List<Item> hero_inventory;
public Integer itemslot;
public Integer charges;
Expand Down Expand Up @@ -676,6 +677,7 @@ public void onTickStart(Context ctx, boolean synthetic) {
// System.err.println(pr);
for (int i = 0; i < numPlayers; i++) {
Integer hero = getEntityProperty(pr, "m_vecPlayerTeamData.%i.m_nSelectedHeroID", validIndices[i]);
Integer variant = getEntityProperty(pr, "m_vecPlayerTeamData.%i.m_nSelectedHeroVariant", validIndices[i]);
int handle = getEntityProperty(pr, "m_vecPlayerTeamData.%i.m_hSelectedHero", validIndices[i]);
int playerTeam = getEntityProperty(pr, "m_vecPlayerData.%i.m_iPlayerTeam", validIndices[i]);
int teamSlot = getEntityProperty(pr, "m_vecPlayerTeamData.%i.m_iTeamSlot", validIndices[i]);
Expand Down Expand Up @@ -741,6 +743,7 @@ public void onTickStart(Context ctx, boolean synthetic) {
// get the hero's entity name, ex: CDOTA_Hero_Zuus
entry.unit = e.getDtClass().getDtName();
entry.hero_id = hero;
entry.variant = variant;
entry.life_state = getEntityProperty(e, "m_lifeState", null);
// check if hero has been assigned to entity
if (hero > 0) {
Expand Down

0 comments on commit c621405

Please sign in to comment.