View Single Post
  #11  
Old 08-03-2010, 11:43 PM
Aleksandar Aleksandar is offline
Registered Member
 
Join Date: Aug 2010
Posts: 10
Default

Quote:
Originally Posted by Goblin Wizard View Post
@Aleksandar - nice to see an educated programmer here. I like poking through the scripts but it's just a hobby.
btw if I understand correctly - your script does the same as original only in other way. AFAIK CanAddProperty function is base function called from the exe so you shouldn't change it's name.
In a somewhat better and cleaner way. I understand that they never planned on having more than 3 prereqs and/or denials, but really - hardcoding to check only for one, two or three arguments is really lame. If you put in four denials the script would just return FALSE without checking anything. Mine evaluates the first one and collates (uses all the solutions so far in calculating the next one) all the others, either until it runs out of arguments or one of the prereqs hits FALSE. Then same (but inverse) applies for Denials (i just call them that way) after which the prereqsMet and !deniesMet vars are anded.

This way I can have as many prereqs and denies as I want and I'm not limited only to the first three. I believe these kind of bad coding practices are the root of all the limitations, such as having only 6 pilots and that crap.
Reply With Quote