Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2238 closed defect (fixed)

[PATCH] bug in GarrisonHolder

Reported by: mimo Owned by: leper
Priority: Should Have Milestone: Alpha 15
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

There is a problem in OnHealthChanged of GarrisonHolder which pass this.entities as argument to functions which will eventually remove elements to this.entities inside a do loop on the argument array. This patch copy the array before passing it.

In addition, in the EjectOrKill function, we could have remaining entities which were neither killed nor ejected in the case of failed ejection. This patch reorder the function on order to prevent this.

Attachments (1)

garrison.diff (2.2 KB ) - added by mimo 11 years ago.

Download all attachments as: .zip

Change History (4)

by mimo, 11 years ago

Attachment: garrison.diff added

comment:1 by leper, 11 years ago

Component: Core engineUI & Simulation

Looks good. Any specific reason why the PostMessage is in the loop and not after it? I guess that is an oversight from when that code was originally written.

comment:2 by leper, 11 years ago

Owner: set to leper
Resolution: fixed
Status: newclosed

In 14049:

Copy this.entites in GarrisonHolder before passing and modifying it. Patch by mimo. Fixes #2238.

comment:3 by leper, 11 years ago

Keywords: review removed
Note: See TracTickets for help on using tickets.