From a31d3c4b8806470f19d522a08432d6fb587261ab Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Sun, 3 May 2026 15:56:09 +0200 Subject: [PATCH] fix: iw4 physpreset uses FLT_MAX as infinite friction --- .../Game/IW4/PhysPreset/InfoStringLoaderPhysPresetIW4.cpp | 2 +- .../Game/IW4/PhysPreset/PhysPresetInfoStringDumperIW4.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ObjLoading/Game/IW4/PhysPreset/InfoStringLoaderPhysPresetIW4.cpp b/src/ObjLoading/Game/IW4/PhysPreset/InfoStringLoaderPhysPresetIW4.cpp index 159fbd88..c71d4726 100644 --- a/src/ObjLoading/Game/IW4/PhysPreset/InfoStringLoaderPhysPresetIW4.cpp +++ b/src/ObjLoading/Game/IW4/PhysPreset/InfoStringLoaderPhysPresetIW4.cpp @@ -45,7 +45,7 @@ namespace physPreset.bounce = physPresetInfo.bounce; if (physPresetInfo.isFrictionInfinity != 0) - physPreset.friction = std::numeric_limits::infinity(); + physPreset.friction = std::numeric_limits::max(); else physPreset.friction = physPresetInfo.friction; diff --git a/src/ObjWriting/Game/IW4/PhysPreset/PhysPresetInfoStringDumperIW4.cpp b/src/ObjWriting/Game/IW4/PhysPreset/PhysPresetInfoStringDumperIW4.cpp index 7df7ebee..bd734f92 100644 --- a/src/ObjWriting/Game/IW4/PhysPreset/PhysPresetInfoStringDumperIW4.cpp +++ b/src/ObjWriting/Game/IW4/PhysPreset/PhysPresetInfoStringDumperIW4.cpp @@ -37,7 +37,7 @@ namespace physPresetInfo->mass = physPreset->mass; physPresetInfo->bounce = physPreset->bounce; - if (std::isinf(physPreset->friction)) + if (physPreset->friction >= std::numeric_limits::max()) { physPresetInfo->isFrictionInfinity = 1; physPresetInfo->friction = 0;