skadistats / clarity

Comically fast Dota 2, CSGO, CS2 and Deadlock replay parser written in Java.
BSD 3-Clause "New" or "Revised" License
664 stars 122 forks source link

New Version from Valve #307

Closed STRATZ-Ken closed 1 year ago

STRATZ-Ken commented 1 year ago

All replays fail with java.lang.ArrayIndexOutOfBoundsException: Index 214026 out of bounds for length 16384

STRATZ-Ken commented 1 year ago

If I recall correctly, this happened before and was solved with https://github.com/skadistats/clarity/commit/c2f468723948001ea69509841d7fdf69cb3216f5

STRATZ-Ken commented 1 year ago

Looks like something to do with Roshan. His ItemHandles are now 492563, so when calling Entity child = entities.getByIndex(itemHandle); We get a crash.

STRATZ-Ken commented 1 year ago

So this is happening on all Entities, not just Roshan. They are just extremely high and out of bounds. Not sure exactly what changed.

STRATZ-Ken commented 1 year ago

OK. So here is a bit of information. Valve has been doing a lot of stuff lately on replays. About 2 weeks ago, they changed from entities.getByHandle(itemHandle); to entities.getByIndex(itemHandle); for getting an Item or Abilities from an existing Entity. (Example would be getting what item hero A has in slot 0). Now, yesterday they switched back from getByIndex to getByHandle. I adjusted my code to support both versions with this :

Entity child = entities.getByHandle(itemHandle);
                        if (child == null && itemHandle <= 16384)
                            child = entities.getByIndex(itemHandle);

We are now working again.