Skip to content

Commit

Permalink
update player effects
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeulater committed Dec 30, 2023
1 parent 12e9379 commit be4c166
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions xlive/Blam/Engine/effects/player_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void player_effect_apply_camera_effect_matrix(int32 user_index, real_matrix4x3*
{
s_player_effect_user_globals* user_effect = player_effects_get_user_globals(user_index);
bool bit_1_result = user_effect->flags.test(_player_effect_apply_camera_impulse);
if (user_effect->camera_impulse_passed_time > 0 || bit_1_result)
if (user_effect->camera_impulse_countdown > 0 || bit_1_result)
{
real32 transition_result;
if (bit_1_result)
Expand All @@ -83,11 +83,14 @@ void player_effect_apply_camera_effect_matrix(int32 user_index, real_matrix4x3*
}
else
{
real32 camera_impulse_remaining_time = user_effect->camera_impulse.duration - ((real32)user_effect->camera_impulse_passed_time - halo_interpolator_get_interpolation_time());
real32 impulse_passed_time = user_effect->camera_impulse.duration - (real32)user_effect->camera_impulse_countdown;
// do not stale the transition function
impulse_passed_time += halo_interpolator_get_interpolation_time();

transition_result = player_effect_transition_function_evaluate(
(e_transition_function_type)user_effect->camera_impulse.fade_function,
user_effect->transition_function_scale_9C,
camera_impulse_remaining_time,
impulse_passed_time,
user_effect->camera_impulse.duration);
}

Expand Down
2 changes: 1 addition & 1 deletion xlive/Blam/Engine/effects/player_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct s_player_effect_user_globals
real32 field_78;
int16 field_7C;
int16 game_time;
int16 camera_impulse_passed_time;
int16 camera_impulse_countdown;
int16 camera_shake_passed_time;
int8 field_84[4];
c_flags<e_player_effect_user_global_flags, uint8, k_player_effect_user_global_flag_count> flags;
Expand Down

0 comments on commit be4c166

Please sign in to comment.