Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2011, 10:39 AM
Octocat Octocat is offline
Approved Member
 
Join Date: Dec 2011
Posts: 22
Default

I am absolutely sure that group.GetItems() does not return a direct reference to an internal list of aircraft, but makes a copy. So the trick with the list is not needed.
Reply With Quote
  #2  
Old 12-18-2011, 11:42 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Yes it returns a copy. However as I used a "for" loop I got the updated copy of the list for every iteration of the loop. Hence the list has changed for every iteration and the indices didn't match anymore to the updated list.

I changed the code to use a "foreach" loop. It's now the same code as yours, only added checks against null references.

Last edited by 41Sqn_Banks; 12-18-2011 at 11:45 AM.
Reply With Quote
  #3  
Old 12-18-2011, 02:01 PM
KG26_Alpha KG26_Alpha is offline
Approved Member
 
Join Date: Jan 2008
Location: London
Posts: 2,805
Default

Ok

Whilst its nice of you to be putting these scripts up for general use...........

Quote:
Originally Posted by 41Sqn_Banks View Post
Edit: Even better code to destroy all aircraft
Perhaps for the sake of those that don't understand why you would want to have to use such a script,
you can in future put an explanation of the scripts use and reason of its need.

I understand clearing old aircraft frees up the missions resources and clears old planes from airfields etc etc.

Not everyone will know that though.

Thxz
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:18 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.