sfall-team / sfall

sfall - Engine modifications for Fallout 2
https://sfall-team.github.io/sfall/
GNU General Public License v3.0
338 stars 40 forks source link

PlayIdleAnimOnReload=1 Causes to lose highlighting after reload in combat #528

Closed xMatth3w closed 2 months ago

xMatth3w commented 2 months ago

Basically title. After enabling this settings, it will play the reload animation to a weapon, but after you reload combat highlight doesn't work and you have to press shift after every reload to higlight critters in combat. I don't know if it's a limitation of this settings or not working as inteded. Tested on fresh FO2 + newest Sfall

NovaRain commented 2 months ago

I can't seem to reproduce that in my game. In a random encounter with two group of enemies fighting each other, I shoot someone and reload (playing "idle" animation), all critters still have their combat highlight (outlines) in subsequent turns.

EDIT: OK I got it. This specifically happens when the Target Highlight preference is in the default "targeting only".

Some boring technical details: PlayIdleAnimOnReload inserts an animation sequence, and at the end of sequence it calls register_end() which invokes combat_anim_begin(). If the Target Highlight is targeting only (combat_highlight == 2), combat_anim_begin() will turn off highlights in combat. So my fix is simple: force change the setting right before calling register_end() to avoid turning off combat highlights, then restore the setting afterward.