bug fixes, logic fixes

This commit is contained in:
explorer 2024-10-18 01:46:40 +03:00
parent 1af4705b49
commit 2028a2886b
4 changed files with 46 additions and 75 deletions

View File

@ -179,20 +179,13 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
{
if (Extra_Commands < 1)
{
if (Reserve == 0)
{
*(__int32*)((unsigned __int32)Network_Channel + 8) += 150;
}
else
{
__int32 Sequence_Shift = (*(__int32*)((unsigned __int32)Local_Player + 5324) + ~- 150) / 150 * 150 + (Reserve * 150);
__int32 Sequence_Shift = (*(__int32*)((unsigned __int32)Local_Player + 5324) + ~-150) / 150 * 150 + (Reserve * 150);
if (Sequence_Shift > 0)
{
*(__int32*)((unsigned __int32)Network_Channel + 8) += Sequence_Shift;
}
}
}
*(__int32*)((unsigned __int32)Local_Player + 20) = 1 + (Reserve > 0);
};
@ -363,10 +356,10 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
__int8 Is_Melee = *(__int32*)((unsigned __int32)Weapon_Data + 352) * (*(__int32*)((unsigned __int32)Weapon_Data + 348) ^ 1) <= 1;
__int8 Healing = (*(__int32*)((unsigned __int32)Local_Player + 7080) == 1) + (*(void**)((unsigned __int32)Local_Player + 8076) != INVALID_HANDLE_VALUE);
__int8 Reloading = *(__int8*)((unsigned __int32)Weapon + 2493);
__int32 Healing = (*(__int32*)((unsigned __int32)Local_Player + 7080) == 1) + (*(void**)((unsigned __int32)Local_Player + 8076) != INVALID_HANDLE_VALUE);
__int32 Weapon_Identifier = Get_Identifier(Weapon, 1, 0);
__int8 Is_Cold_Melee = Weapon_Identifier == 231;
@ -389,7 +382,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
__int8 Forced = 0;
if (Is_Melee + Healing + Reloading != 0)
if ((Is_Melee + Reloading) * (Healing ^ 1) != 0)
{
if ((Target->Identifier ^ 72) % 348 >= 72)
{
@ -405,7 +398,9 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
{
__int8 Infected = (Target->Identifier == 264) * (Forced ^ 1);
if ((Infected ^ 1) + (*(__int32*)((unsigned __int32)Target->Self + 52) == 15) != 0)
__int32 Gender = *(__int32*)((unsigned __int32)Target->Self + 52);
if ((Infected ^ 1) + (Gender == 15) != 0)
{
using Get_Sequence_Name_Type = char*(__thiscall*)(void* Entity, __int32 Sequence);
@ -441,6 +436,8 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
Perform_Trace_Target = nullptr;
if (Perform_Trace_Damage == 1)
{
if (Healing == 0)
{
Command->Tick_Number = Target->Tick_Number;
@ -463,15 +460,17 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
Block_Buttons = 1;
if (Interface_Riot_Deprioritize.Integer == 1)
{
Cancelable_Shove = Infected * 2;
}
Cancelable_Shove = (Gender * Interface_Riot_Deprioritize.Integer * (Forced ^ 1)) == 15;
*(float*)((unsigned __int32)Target->Self + 16) = Get_Target_Time(Target);
goto Shove_Found_Target_Label;
}
Cancelable_Shove = 0;
goto Shove_Found_Target_Label;
}
}
}
}
@ -492,7 +491,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
{
__int8 Can_Attack = (*(float*)((unsigned __int32)Weapon + 2400) <= Global_Variables->Current_Time) * (*(__int32*)((unsigned __int32)Weapon + 2436) > 0 - Is_Melee * 2) * (*(float*)((unsigned __int32)Local_Player + 3872) <= Global_Variables->Current_Time);
if (Healing + (Can_Attack ^ 1) + (Weapon_Identifier == 96) == 0)
if ((Weapon_Identifier == 96) + (Can_Attack ^ 1) == 0)
{
Target_Structure* Aim_Target = nullptr;
@ -700,34 +699,6 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
}
}
}
else
{
if (Weapon_Identifier == 73)
{
//ideally 150 commands should always be buffered beforehand
//at worst buffer them right before slot* command
//current solution without buffering takes (interval_per_tick*150) seconds to prepare itself
//reason why i'm not doing that now is because it'll take time to redesign prediction code to function properly
//specifically:
//ignoring network time updates for good period of time isn't good idea
//viewmodel animations will jitter at moment of centering around network time
//so is interpolation
//besides all that, it'll invoke clock correction on server's side and that's pretty unstable (especially on ~100 tickrate)
Global_Variables->Current_Time -= Global_Variables->Interval_Per_Tick * 150;
//leaving other ones of sanity for later
if (*(float*)((unsigned __int32)Weapon + 2400) <= Global_Variables->Current_Time)
{
if ((Command->Buttons & 2049) != 0)
{
Sequence_Shift(0);
Block_Buttons = 1;
}
}
}
}
if ((Command->Buttons & 1) == 1)
{

View File

@ -50,7 +50,7 @@ __int32 Get_Identifier(void* Entity, __int8 Raw, __int8 Equipment)
{
if (*(__int8*)((unsigned __int32)Entity + 221) == 0)
{
if (*(__int32*)((unsigned __int32)Entity + 572) == 131088)
if ((*(__int32*)((unsigned __int32)Entity + 572) - 131088 & 255) == 0)
{
using Get_Sequence_Name_Type = char*(__thiscall*)(void* Entity, __int32 Sequence);

View File

@ -1,6 +1,6 @@
void __thiscall Perform_Shove_Trace(void* Stack)
{
void* Entity = *(void**)((unsigned __int32)Stack - 276);
void* Entity = *(void**)((unsigned __int32)Stack + 332);
if (Entity == Perform_Trace_Target)
{

View File

@ -6,20 +6,20 @@ void __thiscall Redirected_Spawn_Grenade(void* Entity)
float Minimum[3] =
{
-16,
-16.f,
-16,
-16.f,
-16
-16.f
};
float Maximum[3] =
{
16,
16.f,
16,
16.f,
16
16.f
};
Set_Size_Type((unsigned __int32)Client_Module + 281664)(Entity, Minimum, Maximum);