Xilmi / OpenXcom

Open-source clone of the original X-Com
http://openxcom.org
GNU General Public License v3.0
19 stars 10 forks source link

Pressing 'Alt' to show unit facing arrow in battlescape only works sometimes #45

Closed zrrr111 closed 4 days ago

zrrr111 commented 6 days ago

Hi. It seems recent changes and merge issues with src/Battlescape/Map.cpp broke unit facing arrow feature.

In both latest OXCE and BOXCE pressing 'alt' in battlescape should make an arrow icon appear above any unit. In BOXCE 9.1.5 it only works sometimes, and breaks or fixes itself after several battlescape reloads (with quickload, for example)

Possible cause is use of uninitialized _isCtrlPressed object field in Map.cpp#L711, which was added with merge from upstream, removed, and later readded with another merge. Maybe adding initializer in constructor or setting it like upstream does Map.cpp#L734 can fix it.

Xilmi commented 6 days ago

I used the suggested change and with it couldn't reproduce the issue. Not sure if it's definitely fixed or I'm just lacking the proper way to reproduce it though.

zrrr111 commented 4 days ago

Works for me and other people, who complained before, so I believe this is fixed in 9.2.0.