fix UnboundLocalError: local variable 't' referenced before assignment
Merge pull request #487 from homm/master

fix UnboundLocalError: local variable 't' referenced before assignment