wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps
https://wurstlang.org
Apache License 2.0
226 stars 28 forks source link

[compiletime] `BlzGroupRemoveGroupFast` must return the number of removed units #1011

Closed GetLocalPlayer closed 3 years ago

GetLocalPlayer commented 3 years ago
@Test
function test()
    unit array u
    for i = 0 to 9
        u[i] = createUnit(localPlayer, 'hfoo', ZERO2, angle(0))
    let g = CreateGroup()
    let a = CreateGroup()
    ..add(u[0], u[1], u[2], u[3], u[4])
    let b = CreateGroup()
    ..add(u[2], u[3], u[4], u[5])
    print(BlzGroupAddGroupFast(a, g))
    print(BlzGroupAddGroupFast(b, g))
    print("size = " + g.size().toString())
    print(BlzGroupRemoveGroupFast(a, g))
    print(BlzGroupRemoveGroupFast(b, g))
    print("size = " + g.size().toString())

init
    doAfter(1) ->
        test()

Ingame output: Screenshot_6

Compiletime output:

Running <Hello:6 - test>..
5
1
size = 6
1
0
size = 0
    OK!
Tests succeeded: 1/1
Frotty commented 3 years ago

thx for these detailed reports 👍