nmrih / source-game

Bugs and issues reporting for NMRiH1
http://store.steampowered.com/app/224260
58 stars 25 forks source link

[public-1.13.5] MapHack: $modify ignores multiple keyfield filters #1474

Closed dysphie closed 1 month ago

dysphie commented 1 month ago

Maphack's $modify feature matches entities that don't pass all match filters

Repro steps:

  1. Map with this entity:

    entity
    {
    "id" "33"
    "classname" "game_text"
    "channel" "1"
    "color" "0 255 0"
    "color2" "240 110 0"
    "fadein" "1.5"
    "fadeout" "0.5"
    "fxtime" "0.25"
    "holdtime" "1.2"
    "message" "Good"
    "targetname" "text"
    "x" "-1"
    "y" "-1"
    "origin" "128 128 -24"
    editor
    {
        "color" "220 30 220"
        "visgroupshown" "1"
        "visgroupautoshown" "1"
        "logicalpos" "[0 1500]"
    }
    }
  2. This maphack;

    "Maphack"
    {
    "pre_entities"
    {
        $modify
        {
            "match"
            {
                "classname" "game_text"
                "targetname" "nevermatch" // shouldn't find any entity
            }
            "replace"
            {
                "message"   "Bad"
            }
        }
    }
    }

ent_fire text display will show the entity has been edited despite not matching all the fields

felis-catus commented 1 month ago

Fixed in src-r7562.