sarbian / ModuleManager

177 stars 95 forks source link

Target all keys with a math operator bug #64

Closed jsolson closed 7 years ago

jsolson commented 7 years ago

MM 2.7.3. Using target all keys with a math operator assigns garbage on the last match. It does appear to work fine with simple assignment. Can't access the server to grab the previous version. It does happen with 2.7.0 though.

(I'm trying to do this: @node_stack*,*[1,,] *= #$factor$)

Addition:

MMADD
{
    field_a = 1

    field_b = 1
    field_b = 1

    field_c = 1
    field_c = 1
    field_c = 1
    field_c = 1
}

@MMADD
{
    @field_a,* += 2
    @field_b,* += 2
    @field_c,* += 2
}

Result:

    MMADD
    {
        field_a = 15

        field_b = 3
        field_b = 13

        field_c = 3
        field_c = 3
        field_c = 3
        field_c = 9
    }

Multiplication:

MMMULT
{
    field_a = 1

    field_b = 1
    field_b = 1

    field_c = 1
    field_c = 1
    field_c = 1
    field_c = 1
}

@MMMULT
{
    @field_a,* *= 2
    @field_b,* *= 2
    @field_c,* *= 2
}

Result:

    MMMULT
    {
        field_a = 128

        field_b = 2
        field_b = 64

        field_c = 2
        field_c = 2
        field_c = 2
        field_c = 16
    }

Assignment is ok:

MMASSIGN
{
    field_a = 1

    field_b = 1
    field_b = 1

    field_c = 1
    field_c = 1
    field_c = 1
    field_c = 1
}

@MMASSIGN
{
    @field_a,* = 2
    @field_b,* = 2
    @field_c,* = 2
}

Result:

    MMASSIGN
    {
        field_a = 2

        field_b = 2
        field_b = 2

        field_c = 2
        field_c = 2
        field_c = 2
        field_c = 2
    }
sarbian commented 7 years ago

Thanks for the report with a clean test case 👍