aboutsummaryrefslogtreecommitdiff
path: root/games/devilutionX/files/patch-Source_engine_random.cpp
blob: ac57d195923fd451381b9a9d13904d49f2ca901e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
https://github.com/diasurgical/devilutionX/pull/4588

--- Source/engine/random.cpp.orig	2022-04-25 02:21:41 UTC
+++ Source/engine/random.cpp
@@ -29,7 +29,8 @@ uint32_t GetLCGEngineState()
 
 int32_t GetRndSeed()
 {
-	return abs(static_cast<int32_t>(sglGameSeed));
+	const int32_t seed = static_cast<int32_t>(sglGameSeed);
+	return seed == -2147483648 ? -2147483648 : abs(seed);
 }
 
 int32_t AdvanceRndSeed()