Merge pull request #19 from Dmitry450/master

Added self.target_flag.node.exists() check in spazBot.update_ai()
This commit is contained in:
Eric Froemling 2020-04-13 12:15:29 -07:00 committed by GitHub
commit 996b33809e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -253,6 +253,7 @@ class SpazBot(basespaz.Spaz):
# Otherwise try to go pick it up. # Otherwise try to go pick it up.
else: else:
assert self.target_flag.node assert self.target_flag.node
if self.target_flag.node.exists():
target_pt_raw = ba.Vec3(*self.target_flag.node.position) target_pt_raw = ba.Vec3(*self.target_flag.node.position)
diff = (target_pt_raw - our_pos) diff = (target_pt_raw - our_pos)
diff = ba.Vec3(diff[0], 0, diff[2]) # Don't care about y. diff = ba.Vec3(diff[0], 0, diff[2]) # Don't care about y.