GraylinKim / sc2reader

A python library that extracts data from various Starcraft II resources to power tools and services for the SC2 community. Who doesn't want to hack on the games they play?
http://sc2reader.readthedocs.org
MIT License
413 stars 85 forks source link

Problem in Observer class #174

Closed EHadoux closed 9 years ago

EHadoux commented 10 years ago

Hi,

it seems that the shortcut on is_observer does not work in Gameheart. Here is a minimal code:

import sc2reader
from sc2reader.objects import Observer
replay = sc2reader.load_replay('./test_replays/gameheart/gameheart.SC2Replay', load_level=4)
for human in replay.humans:
    if(not (human.is_observer or human.is_referee) and isinstance(human, Observer)):
        print("{} bug".format(human.name))
    else:
        print(human.name)

Some guys are neither observer nor referee but are an instance of Observer class.