-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
void __fastcall c_cs_player _ :: do_animation_event (void * ecx, void * edx, int event)
{
// note: ecx = animstate
// to get to player, offset it backwards by 0x3900
uintptr_t animstate_location = uintptr_t (ecx);
ptrdiff_t offset = 0x3900;
uintptr_t player_location = animstate_location - offset;
// get player
c_cs_player * player = reinterpret_cast <c_cs_player *> (player_location);
size_t player_index = player-> index ();
c_cs_player * player_from_index = reinterpret_cast <c_cs_player *> (client_entity_list () -> get_client_entity (player_index));
if (! player ||! player_from_index)
return _do_animation_event (ecx, edx, event);
if (player_from_index! = player)
return _do_animation_event (ecx, edx, event);
const auto & current_records = animation_system-> get_player_records (player);
const auto & record = current_records.back ();
// skip all animation events due to lack of records
if (! record)
return
// events for record align with true events
if (record.animation_event == event)
{
// event == animation_event_primary_fire
if (event == get_anim_event (0))
return
// event == animation_event_secondary_fire
if (event == get_anim_event (1))
return
}
// leg approach has now been skipped
_do_animation_event (player, edx, event);
// update animation events on record
record.update_animation_events ();
record.log_animation_events ();
record.patch_animation_events (event); [/ CODE] [/ CODE]