{"action":"created","issue":{"url":"https://api.github.com/repos/wesnoth/wesnoth/issues/698","repository_url":"https://api.github.com/repos/wesnoth/wesnoth","labels_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/698/labels{/name}","comments_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/698/comments","events_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/698/events","html_url":"https://github.com/wesnoth/wesnoth/pull/698","id":165861818,"number":698,"title":"New features for [role]","user":{"login":"GregoryLundberg","id":11877870,"avatar_url":"https://avatars.githubusercontent.com/u/11877870?v=3","gravatar_id":"","url":"https://api.github.com/users/GregoryLundberg","html_url":"https://github.com/GregoryLundberg","followers_url":"https://api.github.com/users/GregoryLundberg/followers","following_url":"https://api.github.com/users/GregoryLundberg/following{/other_user}","gists_url":"https://api.github.com/users/GregoryLundberg/gists{/gist_id}","starred_url":"https://api.github.com/users/GregoryLundberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GregoryLundberg/subscriptions","organizations_url":"https://api.github.com/users/GregoryLundberg/orgs","repos_url":"https://api.github.com/users/GregoryLundberg/repos","events_url":"https://api.github.com/users/GregoryLundberg/events{/privacy}","received_events_url":"https://api.github.com/users/GregoryLundberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":64,"created_at":"2016-07-15T19:35:18Z","updated_at":"2016-07-21T23:36:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/wesnoth/wesnoth/pulls/698","html_url":"https://github.com/wesnoth/wesnoth/pull/698","diff_url":"https://github.com/wesnoth/wesnoth/pull/698.diff","patch_url":"https://github.com/wesnoth/wesnoth/pull/698.patch"},"body":"This builds upon [CelticMinstrel's changes](https://github.com/wesnoth/wesnoth/commit/d4b8fec953ca81531d323774a39da90445dfd3d6) from a few days ago.\r\n\r\nOn code-reading, I see he made allowances to bypass searching the map. Also, he asked about whether a [role] would re-assign the role if a better match was found. On testing, I found, it did. As a result, I added the following new attributes for the [role] tag.\r\n\r\n    search_map=yes|no (optional, default yes)\r\n    reassign=yes|no (optional, default yes)\r\n\r\nThe search_map attribute determines whether units presently on the map should be considered for the role. Note that if both search_map and search_recall_list are specified as 'no' the [else] sub-tag always executes; if there also is no [else] tag the [role] tag does nothing at all. (These might be cases for wmllint to check for, someday.)\r\n\r\nThe reassign attribute determines whether, if a unit already has the role, the role should be re-assigned to a 'better' unit. Here, 'better' means either appears earlier in the listed types, or earlier in whatever the order happens to be in the list of units matching the filters.\r\n\r\nConsider one use case: a map with a number of Mages and one Red Mage.\r\n\r\n1) Use [role] in the normal way to assign role=MageAdvisor to the Red Mage using types=\"White Mage,Red Mage,Mage\".\r\n\r\n2) Advance some of the Mages to Red Mage, some to White Mage.\r\n\r\n3) Use [role] with the same type list and reassign=no. The same Red Mage will still have the role MageAdvisor without regard to whether 'better' advisors might now be available.\r\n\r\n4) Kill the Red Mage with the role MageAdvisor\r\n\r\n4) Use [role] with the same type list and reassign=no. Now, there is no unit with the role, so it must be assigned. One of the White Mages will be selected.\r\n"},"comment":{"url":"https://api.github.com/repos/wesnoth/wesnoth/issues/comments/234415696","html_url":"https://github.com/wesnoth/wesnoth/pull/698#issuecomment-234415696","issue_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/698","id":234415696,"user":{"login":"GregoryLundberg","id":11877870,"avatar_url":"https://avatars.githubusercontent.com/u/11877870?v=3","gravatar_id":"","url":"https://api.github.com/users/GregoryLundberg","html_url":"https://github.com/GregoryLundberg","followers_url":"https://api.github.com/users/GregoryLundberg/followers","following_url":"https://api.github.com/users/GregoryLundberg/following{/other_user}","gists_url":"https://api.github.com/users/GregoryLundberg/gists{/gist_id}","starred_url":"https://api.github.com/users/GregoryLundberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GregoryLundberg/subscriptions","organizations_url":"https://api.github.com/users/GregoryLundberg/orgs","repos_url":"https://api.github.com/users/GregoryLundberg/repos","events_url":"https://api.github.com/users/GregoryLundberg/events{/privacy}","received_events_url":"https://api.github.com/users/GregoryLundberg/received_events","type":"User","site_admin":false},"created_at":"2016-07-21T23:36:28Z","updated_at":"2016-07-21T23:36:28Z","body":"Correct, auto_recall only recalls when (1) reassign=no and the unit was found in the recall list, or (2) the role was assigned to a unit on the recall list (even if there is another with the role also there).\r\n\r\nI take it 1.13.5 is being tagged. Are you using the even-stable odd-testing rule? 1.13.4+dev has a lot of UI bugs. The one which is most annoying, today, is that the semi-colon for the command line does not get removed and I keep forgetting to ';' <backspace> 'debug' and get the error ';debug is unknown' or some such.\r\n\r\nPersonally, I don't care when the PR goes in (or, TBH, if it does), or when .. to me, that's completely up to those who have commit rights."}}
{"actor":{"display_login":"GregoryLundberg"}}