Opened 9 years ago

Last modified 9 years ago

#980 new defect

Game crash when attack command is sent with an entity instead of entity id

Reported by: Jonathan Waller Owned by:
Priority: Nice to Have Milestone: Backlog
Component: Core engine Keywords:
Cc: Patch:


If a malformed command is sent (from an AI script) using

Engine.PostCommand({"type": "attack", "entities": tasked, "target": ent, "queued": false});

instead of

Engine.PostCommand({"type": "attack", "entities": tasked, "target":, "queued": false});

then the game crashes with: unhandled exception (Access violation reading 0x00000008)

Attachments (2)

crashlog.txt (11.5 KB ) - added by Jonathan Waller 9 years ago.
crashlog.dmp (59.1 KB ) - added by Jonathan Waller 9 years ago.

Download all attachments as: .zip

Change History (3)

by Jonathan Waller, 9 years ago

Attachment: crashlog.txt added

by Jonathan Waller, 9 years ago

Attachment: crashlog.dmp added

comment:1 by historic_bruno, 9 years ago

Ah, looks like WriteStructuredClone is failing silently (because the serialized object contains an object reference?), we don't handle this condition and end up with an empty StructuredClone - there's a TODO in the code about this. Then ReadStructuredClone crashes when the command is processed. If WriteStructuredClone fails then the whole command fails, so I guess we should report the error and ignore the command.

Note: See TracTickets for help on using tickets.