Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix renamed/removed unit images in MP Aethermaw (wesnoth#8432)
Playing the multiplayer scenario Aethermaw as Loyalists vs. Undead revealed some image errors: 20240219 06:50:21 error image: could not open image 'units/undead/shadow-s-attack-1.png' 20240219 06:50:21 error image: could not open image 'units/undead/shadow-s-attack-4.png' 20240219 06:50:21 error image: could not open image 'units/undead/shadow-n-3.png' 20240219 06:50:22 error image: could not open image 'units/undead/shadow-n-attack-2.png' 20240219 06:50:26 error image: could not open image 'units/human-loyalists/spearman-attack-se-9.png' 20240219 06:50:26 error image: could not open image 'units/human-loyalists/spearman-attack-se-10.png' 20240219 06:50:26 error image: could not open image 'units/human-loyalists/spearman-attack-s-6.png' 20240219 06:50:26 error image: could not open image 'units/human-loyalists/general-idle-5.png' units/undead/shadow-* images were moved to units/undead-spirit/shadow-* in 1.17.4 commit a2ad3ae, specifically the "1.17 undead sprite cleanup" commit 961b8a3 of PR wesnoth#6655. This was documented on the forums: https://forums.wesnoth.org/viewtopic.php?p=684291&hilit=units%2Fundead-spirit%2F#p684291 wmllint handles renamed images, but it also makes an enormous number of other (often questionable at best) changes (issue wesnoth#5799). So for now, instead of using wmllint, just update Aethermaw for these renamed images as follows (requires GNU sed): git grep -Fl -- 'units/undead/shadow-' \ | grep -v '^data/tools/wmllint$' \ | xargs sed -i 's|units/undead/shadow-|units/undead-spirit/shadow-|' These units/human-loyalists/ images were removed in 1.17.12 commit 8e38cfd, specifically the "spearman image cleanup" commit 775e7f8 and the "remove left-over old general frames" commit e07d554 in PR wesnoth#7208. But Aethermaw still uses them. Restore the removed images that are still used: git grep -EIh -- '^[^#]*[{]PLACE_IMAGE[^ ]* +[(]?"?[^{}$ ~")]+[ ~")].*$' data/ \ | sed -E 's|^.*[{]PLACE_IMAGE[^ ]* +[(]?"?([^{}$ ~")]+)[ ~")].*$|\1|' \ | while read -r img; do [ -e data/core/images/${img} ] && continue [ -e data/campaigns/*/images/${img} ] && continue [ -e ${img} ] && continue git show 8e38cfd~1:data/core/images/${img} 1>data/core/images/${img} done Also add a CI check to prevent this from happening in the future. Example output without these Aethermaw fixes: data/multiplayer/scenarios/2p_Aethermaw.cfg:134: missing image: units/undead/shadow-s-attack-1.png data/multiplayer/scenarios/2p_Aethermaw.cfg:135: missing image: units/undead/shadow-n-attack-2.png data/multiplayer/scenarios/2p_Aethermaw.cfg:147: missing image: units/undead/shadow-n-3.png data/multiplayer/scenarios/2p_Aethermaw.cfg:149: missing image: units/undead/shadow-s-attack-4.png data/multiplayer/scenarios/2p_Aethermaw.cfg:196: missing image: units/human-loyalists/spearman-attack-se-10.png data/multiplayer/scenarios/2p_Aethermaw.cfg:197: missing image: units/human-loyalists/spearman-attack-s-6.png data/multiplayer/scenarios/2p_Aethermaw.cfg:198: missing image: units/human-loyalists/spearman-attack-se-9.png data/multiplayer/scenarios/2p_Aethermaw.cfg:203: missing image: units/human-loyalists/general-idle-5.png
- Loading branch information