Snippet Stack Safety (Pack)

Discussion in 'Systems and Snippets' started by Jesus4Lyf, Jul 23, 2009.

  1. Bribe

    Bribe vJass errors are legion

    Ratings:
    +67 / 0 / -0
    Unfortunately, this snippet is now outdated thanks to Status.
    > Ah, that makes sense

    Also, I don't think you used AIDS correctly in your snippet (you need to use: //! runtextmacro AIDS())
    > Won't hooking the onEnter command suffice? I don't think this needs the whole textmacro; just wanted to catch the units as they come through :-j

    But a good idea turning four libraries into one. :)
    > Aye, consolidation, one of my favorite things about programming ;) Thanks
     
  2. Kenny

    Kenny Back for now.

    Ratings:
    +202 / 0 / -0
    That's what AIDS_onCreate() is for.

    JASS:
    private struct UnitData extends array
        //! runtextmacro AIDS()
    
        integer pauseSize
        integer showSize
        integer invulSize
        integer pathSize
            
        private method AIDS_onCreate takes nothing returns nothing
            set this.pauseSize = 0
            set this.showSize = 0
            set this.invulSize = 0
            set this.pathSize = 0
        endmethod
            
    endstruct


    I'm pretty sure that does the same thing as you were trying to do with your struct.
     
  3. Bribe

    Bribe vJass errors are legion

    Ratings:
    +67 / 0 / -0
    But with 70 lines of textmacro code instead of 3 hand-typed :O

    And what's more, putting the AIDS textmacro at the top of the struct like everyone does will generate lots of text during map compilation (generated method caller/executor for AIDS_onCreate) :(
     

Share This Page