fix UnboundLocalError: local variable 't' referenced before assignment

Variable `t` defined inside `if not self.map` block. That is why `not self.map` check required __before__ `t == 0` check.