small crits update
This commit is contained in:
parent
506df2cccb
commit
441066f5a4
@ -24,11 +24,14 @@ int find_next_random_crit_for_weapon(IClientEntity *weapon)
|
|||||||
number = g_pUserCmd->command_number,
|
number = g_pUserCmd->command_number,
|
||||||
found = 0,
|
found = 0,
|
||||||
seed,
|
seed,
|
||||||
seed_md5;
|
seed_md5,
|
||||||
|
seed_backup;
|
||||||
|
|
||||||
crithack_saved_state state;
|
crithack_saved_state state;
|
||||||
state.Save(weapon);
|
state.Save(weapon);
|
||||||
|
|
||||||
|
seed_backup = *g_PredictionRandomSeed;
|
||||||
|
|
||||||
while (!found && tries < 4096)
|
while (!found && tries < 4096)
|
||||||
{
|
{
|
||||||
seed_md5 = MD5_PseudoRandom(number) & 0x7FFFFFFF;
|
seed_md5 = MD5_PseudoRandom(number) & 0x7FFFFFFF;
|
||||||
@ -41,6 +44,7 @@ int find_next_random_crit_for_weapon(IClientEntity *weapon)
|
|||||||
++number;
|
++number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*g_PredictionRandomSeed = seed_backup;
|
||||||
state.Load(weapon);
|
state.Load(weapon);
|
||||||
if (found)
|
if (found)
|
||||||
return number;
|
return number;
|
||||||
@ -83,7 +87,7 @@ bool force_crit(IClientEntity *weapon)
|
|||||||
{
|
{
|
||||||
if (cached_calculation.init_command > g_pUserCmd->command_number ||
|
if (cached_calculation.init_command > g_pUserCmd->command_number ||
|
||||||
g_pUserCmd->command_number - cached_calculation.init_command > 4096 ||
|
g_pUserCmd->command_number - cached_calculation.init_command > 4096 ||
|
||||||
cached_calculation.command_number < g_pUserCmd->command_number)
|
(g_pUserCmd->command_number && (cached_calculation.command_number < g_pUserCmd->command_number)))
|
||||||
cached_calculation.weapon_entity = 0;
|
cached_calculation.weapon_entity = 0;
|
||||||
if (cached_calculation.weapon_entity == weapon->entindex())
|
if (cached_calculation.weapon_entity == weapon->entindex())
|
||||||
return bool(cached_calculation.command_number);
|
return bool(cached_calculation.command_number);
|
||||||
|
Reference in New Issue
Block a user