{"action":"created","issue":{"url":"https://api.github.com/repos/wesnoth/wesnoth/issues/3220","repository_url":"https://api.github.com/repos/wesnoth/wesnoth","labels_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/3220/labels{/name}","comments_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/3220/comments","events_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/3220/events","html_url":"https://github.com/wesnoth/wesnoth/issues/3220","id":330569245,"node_id":"MDU6SXNzdWUzMzA1NjkyNDU=","number":3220,"title":"[remove_object] doesn't work for \"image_mod\" effect","user":{"login":"vgaming","id":33452702,"node_id":"MDQ6VXNlcjMzNDUyNzAy","avatar_url":"https://avatars3.githubusercontent.com/u/33452702?v=4","gravatar_id":"","url":"https://api.github.com/users/vgaming","html_url":"https://github.com/vgaming","followers_url":"https://api.github.com/users/vgaming/followers","following_url":"https://api.github.com/users/vgaming/following{/other_user}","gists_url":"https://api.github.com/users/vgaming/gists{/gist_id}","starred_url":"https://api.github.com/users/vgaming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgaming/subscriptions","organizations_url":"https://api.github.com/users/vgaming/orgs","repos_url":"https://api.github.com/users/vgaming/repos","events_url":"https://api.github.com/users/vgaming/events{/privacy}","received_events_url":"https://api.github.com/users/vgaming/received_events","type":"User","site_admin":false},"labels":[{"id":35865188,"node_id":"MDU6TGFiZWwzNTg2NTE4OA==","url":"https://api.github.com/repos/wesnoth/wesnoth/labels/Bug","name":"Bug","color":"fc2929","default":false},{"id":862253212,"node_id":"MDU6TGFiZWw4NjIyNTMyMTI=","url":"https://api.github.com/repos/wesnoth/wesnoth/labels/Stable%201.14","name":"Stable 1.14","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-08T08:39:43Z","updated_at":"2018-06-08T18:43:00Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**Steps to reproduce:**\r\n* Add an object with \"image_mod\" effect and remove it. Code:\r\n```lua\r\nT = wesnoth.require(\"lua/helper.lua\").set_wml_tag_metatable {}\r\nunit = wesnoth.get_units {side=1}[1]\r\nwesnoth.add_modification(unit, \"object\", {id = \"afterlife_grayscale\", T.effect { apply_to = \"hitpoints\", increase_total = 1000 },T.effect { apply_to = \"image_mod\", add=\"GS()\" } })\r\nwesnoth.wml_actions.remove_object { id = unit.id, object_id = \"afterlife_grayscale\"}\r\n```\r\n\r\n**Expected at this point:**\r\nThe unit should have it's visual appearance (`image_mod`) intact.\r\n\r\n**Actually:**\r\nThe unit-s visual appearance changes to \"grayscale\". In other words, \"image_mod\" effect persists even though the object has been removed.\r\n\r\nTo be extra sure there's no mistake in the code, check out unit-s health. (You'll see it's being changed around when adding the object and removing it)."},"comment":{"url":"https://api.github.com/repos/wesnoth/wesnoth/issues/comments/395852562","html_url":"https://github.com/wesnoth/wesnoth/issues/3220#issuecomment-395852562","issue_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/3220","id":395852562,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTg1MjU2Mg==","user":{"login":"gfgtdf","id":4893136,"node_id":"MDQ6VXNlcjQ4OTMxMzY=","avatar_url":"https://avatars3.githubusercontent.com/u/4893136?v=4","gravatar_id":"","url":"https://api.github.com/users/gfgtdf","html_url":"https://github.com/gfgtdf","followers_url":"https://api.github.com/users/gfgtdf/followers","following_url":"https://api.github.com/users/gfgtdf/following{/other_user}","gists_url":"https://api.github.com/users/gfgtdf/gists{/gist_id}","starred_url":"https://api.github.com/users/gfgtdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfgtdf/subscriptions","organizations_url":"https://api.github.com/users/gfgtdf/orgs","repos_url":"https://api.github.com/users/gfgtdf/repos","events_url":"https://api.github.com/users/gfgtdf/events{/privacy}","received_events_url":"https://api.github.com/users/gfgtdf/received_events","type":"User","site_admin":false},"created_at":"2018-06-08T18:43:00Z","updated_at":"2018-06-08T18:43:00Z","author_association":"CONTRIBUTOR","body":"ye the observations in post2 match exactly what one would except if image_moid was not reset on rebuild, so it's probably that. The same things i said in #3172 whether/how to fix this also apply to this one . This one is actually a little worse since it also has an add= feature that might add things multiple times as noted in post 2. For ~NOP this is obviously not a huge problem but afaik tere are imagepath functions that have an effect if appled a second time and this bug would break them on units."}}
{"actor":{"display_login":"gfgtdf"}}