From ea1dd6f93be14ead4bc2b30577cfcd28eb4a6b6f Mon Sep 17 00:00:00 2001 From: pionere Date: Mon, 16 Sep 2024 15:41:08 +0200 Subject: [PATCH] bugfix for devilutionx - use time(NULL) instead of SDL_GetTicks to initialize the rnd-seed for new players 1. time(NULL): time since epoch (1970.01.01) 2. SDL_GetTicks: time since the application(SDL) was started --- Source/player.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/player.cpp b/Source/player.cpp index 41311057b497..6fbf857348ab 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -5,6 +5,7 @@ */ #include "all.h" #include "plrctrls.h" +#include DEVILUTION_BEGIN_NAMESPACE @@ -629,7 +630,7 @@ void CreatePlayer(const _uiheroinfo& heroinfo) int i, pnum = 0; memset(&plr, 0, sizeof(PlayerStruct)); - SetRndSeed(SDL_GetTicks()); // used by CreatePlrItems / CreateBaseItem + SetRndSeed(time(NULL)); // used by CreatePlrItems / CreateBaseItem plr._pLevel = heroinfo.hiLevel; plr._pClass = heroinfo.hiClass;