Skip to content

attackerSteamIDs in DF['damages'] rounding error if there is any World or C4 damage done #213

Closed
@Siiggyy

Description

@Siiggyy

If you create a DataFrame with parse_json_to_df the df['damages'] sometimes has a rounding error in the attackerSteamID if there is any damage done through world or C4, since the attackerSteamID for those is of Type None. And if you then create the DF from that the Steamids get messed up.

Issue happens on line 594 in file demoparser.py a fix could be to give world a custom attackerSteamID.

for d in r["damages"]:

                for d in r["damages"]:
                    if(d["weapon"] == "World" or d["weapon"] == "C4"):
                        d["attackerSteamID"] = 0
                    new_d = d 
                    new_d["roundNum"] = r["roundNum"]
                    new_d["matchID"] = self.json["matchID"]
                    new_d["mapName"] = self.json["mapName"]
                    damages.append(new_d)

I currently have it implemented that way World or C4 damage get the attackerSteamID 0.

Added my JSON for testing purposes.
JSON.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions