Skip to content

Commit 0e19ee5

Browse files
committed
swars: Fixed switching between agents in cryon with fast projector
When fast projector was on, switching agents within selected team could lead to cyborg mod images not being refreshed correctly. This fixes the issue, by making sure the blokey draw function spotted that it is not drawing a different agent, even if its index remains the same.
1 parent 3bac0c9 commit 0e19ee5

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/fecryo.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,15 @@ ubyte do_cryo_offer_cancel(ubyte click)
222222
return 0;
223223
}
224224

225+
void clear_mod_draw_states(void)
226+
{
227+
ubyte part;
228+
for (part = 0; part < 4; part++)
229+
{
230+
mod_draw_states[part] = 0;
231+
}
232+
}
233+
225234
void reset_mod_draw_states_flag08(void)
226235
{
227236
ubyte part;
@@ -1006,7 +1015,7 @@ void draw_blokey_body_mods(void)
10061015
if ((current_drawing_mod == ModDPt_BKGND) &&
10071016
(new_current_drawing_mod != ModDPt_BKGND))
10081017
// If previously we were in background drawing, all part buffers
1009-
// need to be clered (background occupied the same buffer)
1018+
// need to be cleared (background occupied the same buffer)
10101019
cryo_cyborg_part_buf_blokey_static_clear_all();
10111020
else if ((current_drawing_mod == ModDPt_BREATH) &&
10121021
(new_current_drawing_mod != ModDPt_BREATH))
@@ -1022,8 +1031,7 @@ void draw_blokey_body_mods(void)
10221031
update_flic_mods(old_flic_mods);
10231032
update_flic_mods(flic_mods);
10241033

1025-
for (part = 0; part < 4; part++)
1026-
mod_draw_states[part] = 0;
1034+
clear_mod_draw_states();
10271035
new_current_drawing_mod = ModDPt_CHEST;
10281036
current_drawing_mod = ModDPt_CHEST;
10291037
current_frame = 0;
@@ -1051,7 +1059,7 @@ void draw_blokey_body_mods(void)
10511059
done = xdo_next_frame(AniSl_CYBORG_INOUT);
10521060
cryo_cyborg_part_buf_blokey_fli_frame_copy(part, AniSl_CYBORG_INOUT);
10531061
still_playing = 1;
1054-
if (done != 0)
1062+
if (done)
10551063
{
10561064
mod_draw_states[part] &= ~(ModDSt_ModAnimIn | ModDSt_Unkn04);
10571065
mod_draw_states[part] |= ModDSt_Unkn04;
@@ -1338,12 +1346,10 @@ ubyte show_cryo_agent_list(struct ScreenTextBox *p_box)
13381346
play_sample_using_heap(0, 111, 127, 64, 100, 0, 2u);
13391347

13401348
switch_local_player_agents(plagent1, selected_agent);
1349+
word_15511E = plagent1;
1350+
check_buy_sell_button();
13411351
update_flic_mods(flic_mods);
1342-
for (i = 0; i < 4; i++)
1343-
{
1344-
if (old_flic_mods[i] != flic_mods[i])
1345-
mod_draw_states[i] |= 0x08;
1346-
}
1352+
set_mod_draw_states_flag08();
13471353
} else {
13481354
play_sample_using_heap(0, 129, 127, 64, 100, 0, 2u);
13491355
}

0 commit comments

Comments
 (0)