View Single Post
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old September 2nd, 2014, 11:58 AM
I think you can simplify that a bit. Maybe something like:

Code:
        var total as number
        total = 0

        ~Make sure at least two Combat Edges exist.
          foreach pick in hero where "EdgeType.Combat"
              total += 1
             if (total >= 2)
                validif (total >= 2)
                done
             endif
          nexteach

        ~if we got here, we're invalid
        if (@ispick <> 0) then
          altpick.linkvalid = 0
          endif
That "done" should get your dropped out of the code a lot quicker if it gets there. I'm also not sure you should bother including the whole "if (@ispick <> 0) then" section since is stays invalid unless it's forced valid by the validif line, but there could be some completely other reason for that of which I'm utterly unaware (which is entirely likely, mind you).

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #6 Reply With Quote