Code will not save

cleeezzz

The Undead Ranger.
Reaction score
268
JASS:
library RingSystem requires CSSafety, HandyFunctions

globals
    private constant real D2R = 3.14159/180
endglobals

struct SD
    //! runtextmacro PUI()
    unit u
    real num
    real r1
    real expand
    real ep
    real mr
    boolean cancel = false
    timer t
    method onDestroy takes nothing returns nothing
        call ReleaseTimer(.t)
        set .t = null
        set .u = null
    endmethod
endstruct

struct RS
    timer t
    unit u
    group g
    real radius
    real br
    real count
    real expand
    real face
    real ep
    real x
    real y
    real z
    real mr
    real period
    static RSCreate takes unit u, real num, real r1, real expand, real ep, real mr, real period returns RS
        local RS d = RS.allocate()
        local real r = 180/num
        local integer a = 0
        local integer b = 0
        local real x
        local real y
        local real z
        local unit tu
        set d.u = u
        set d.face = GetUnitFacing(u) + 90
        set d.g = NewGroup()
        set d.radius = r1
        set d.br = r1
        set d.ep = ep
        set d.mr = mr
        set d.count = num
        set d.expand = expand
        set d.period = period
        set d.x = GetUnitX(u)
        set d.y = GetUnitY(u)
        set d.z = GetUnitFlyHeight(u)
        set d.t = NewTimer()
        loop 
            exitwhen a == 2
            set b = 0
            loop
                exitwhen b > d.count
                set x = d.x + d.radius*Cos((a*180+d.face)*D2R)*Sin((b*r)*D2R)
                set y = d.y + d.radius*Sin((a*180+d.face)*D2R)*Sin((b*r)*D2R)
                set z = d.z + d.radius*Cos((b*r)*D2R)
                set tu = CreateUnit(GetOwningPlayer(u), 'h00Q', x, y, 0)
                call SetUnitX(tu, x)
                call SetUnitY(tu, y)
                call SetUnitZ(tu, z)
                call GroupAddUnit(d.g, tu)
                set b = b + 1
            endloop
            set a = a + 1
        endloop
        set tu = null
        call TimerStart(d.t, ep, true, function RS.Expand)
        call SetCSData(d.t, d)
        return RS
    endmethod
    private method Expand takes nothing returns nothing
        local RS d = GetCSData(GetExpiredTimer())
        local unit fog = null
        local real r = 180/d.count
        local real face = d.face
        local integer a = 0
        local integer b = 0
        local real x
        local real y
        local real z
        local unit tu
        local group g
        set d.radius = d.radius + d.expand
        if d.radius > d.mr then
            call d.destroy()
            return
        endif
        set g = NewGroup()
        call GroupAddGroupAdv(d.g, g)
        loop 
            exitwhen a == 2
            set b = 0
            loop
                exitwhen b > d.count
                set x = d.x + d.radius*Cos((a*180+face)*D2R)*Sin((b*r)*D2R)
                set y = d.y + d.radius*Sin((a*180+face)*D2R)*Sin((b*r)*D2R)
                set z = d.z + d.radius*Cos((b*r)*D2R)
                set fog = FirstOfGroup(g)
                call SetUnitX(fog, x)
                call SetUnitY(fog, y)
                call SetUnitZ(fog, z)
                call GroupRemoveUnit(g, fog)
                set b = b + 1
            endloop
            set a = a + 1
        endloop
        call ReleaseGroup(g)
        set fog = null
    endmethod
    private method Recreate takes nothing returns nothing
        local SD d = GetCSData(GetExpiredTimer())
        call RS.RSCreate(d.u,d.num,d.r1,d.expand,d.ep,d.mr,d.period)
    endmethod
    public static method UnitAddRings takes unit u, real num, real r1, real expand, real ep, real mr, real period returns nothing
        local SD d = SD.create()
        set SD<u> = d
        set d.u = u
        set d.num = num
        set d.r1 = r1
        set d.expand = expand
        set d.ep = ep
        set d.mr = mr
        set d.t = NewTimer()
        call RS.RSCreate(u,num,r1,expand,ep,mr,period)
        call TimerStart(d.t, period, true, function RS.Recreate)
        call SetCSData(d.t, d)
    endmethod
    method onDestroy takes nothing returns nothing
        call ReleaseTimer(.t)
        set .t = null
        call ReleaseGroup(.g)
        set .g = null
        set .u = null
    endmethod
endstruct

endlibrary
</u>


it says, in the create method that "Member Redeclared: integer" (even if i rename b to something ridiculous like b213b1231231)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top