refactor: new overload for SharedRandomExtensions.HashCodeCombine (#40990)
* refactor: new overload for SharedRandomExtensions.HashCodeCombine * Update Content.Shared/Random/Helpers/SharedRandomExtensions.cs --------- Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru> Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -56,7 +56,7 @@ public sealed partial class CatchableSystem : EntitySystem
|
||||
return;
|
||||
|
||||
// TODO: Replace with RandomPredicted once the engine PR is merged
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id);
|
||||
var rand = new System.Random(seed);
|
||||
if (!rand.Prob(ent.Comp.CatchChance))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user