Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#989 closed defect (invalid)

Entity with soldier class but no position

Reported by: Jonathan Waller Owned by:
Priority: Should Have Milestone:
Component: UI & Simulation Keywords:
Cc: Patch:

Description

When Pureon was testing against qBot he hit the error TypeError: ent.position() is undefined in the block of code http://pastebin.com/GFzwHLCG

The full contents of interestinglog are attached.

It was about 10 minutes into a game on Oasis IV with qBot as hele. JuBot was also playing.

Since the line with the error is only run when the entity has CitizenSoldier or Super class I think it must be an engine bug for position to not be defined.

The version of qBot at the time was: https://github.com/quantumstate/qBot/commit/77a95a4160166cf23962d62001324f5b8c45efd7

Attachments (1)

errors.txt (58.3 KB ) - added by Jonathan Waller 13 years ago.
interestinglog contents

Download all attachments as: .zip

Change History (4)

by Jonathan Waller, 13 years ago

Attachment: errors.txt added

interestinglog contents

comment:1 by historic_bruno, 13 years ago

Position doesn't have to be defined, in fact sometimes it isn't (if the entity is off-world, such as when garrisoned or not yet spawned). You should always check that an entity's position is defined before using it :)

comment:2 by Jonathan Waller, 13 years ago

Resolution: invalid
Status: newclosed

Ok, thanks I hadn't considered garrisoning, not yet spawned entities seem a little odd but it is no problem, I have put a check into my code.

comment:3 by Kieran P, 12 years ago

Milestone: Backlog
Note: See TracTickets for help on using tickets.