diff --git a/UnrealProject/Lost_Edge/Content/Levels/Test/Actors/QuickTimeEventTest/BP_Test_QTESingle.uasset b/UnrealProject/Lost_Edge/Content/Levels/Test/Actors/QuickTimeEventTest/BP_Test_QTESingle.uasset index 1a5ffe4..c0df17a 100644 --- a/UnrealProject/Lost_Edge/Content/Levels/Test/Actors/QuickTimeEventTest/BP_Test_QTESingle.uasset +++ b/UnrealProject/Lost_Edge/Content/Levels/Test/Actors/QuickTimeEventTest/BP_Test_QTESingle.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:558c84fe46db65f5ab76797c6b5d649a52e30b5cdc114018c32738696abe00b6 -size 59913 +oid sha256:86d2069ffb0eee3ab463ebd4091cc85f7ae9401d9a58e3d60a3e0926973d8c45 +size 59283 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventMultiPress.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventMultiPress.uasset index 5c1f1e7..f259ae4 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventMultiPress.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventMultiPress.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:39787c495ab8c51c032750e2d87f1e7a11bd2b20414eac0b4fc2d9b9cc7022f3 -size 351320 +oid sha256:7378ac82cd924820c60ac5cc3cb182211e57d9f3970ed7310c4c74f4e2472828 +size 459172 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventSinglePress.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventSinglePress.uasset index 8dc6f6d..3f9527b 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventSinglePress.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventSinglePress.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ca19f836151839979512adc1fd24509f50050132e04ec30f379b6aeaf5b1579d -size 231483 +oid sha256:dc66eb454cb0dbe61ffb1e27d9f0c1e7c8dc01283bb70fd12441b28241d45a4e +size 340216 diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp index ee18efe..2ef71e5 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp @@ -91,31 +91,29 @@ namespace SlowMotion void UCommonFunctions::EnterSlowMotion(float duration) { - if(SlowMotion::targetDilation == SlowMotion::slowDilation) - return; - - SlowMotion::targetDilation = SlowMotion::slowDilation; - auto GI = UCustomGameInstance::Get(); if(!GI) return; auto world = GI->GetWorld(); + if(FloatIsZero(UGameplayStatics::GetGlobalTimeDilation(world) - SlowMotion::slowDilation)) + return; + + SlowMotion::targetDilation = SlowMotion::slowDilation; world->GetTimerManager().SetTimer(SlowMotion::timer, []() { SlowMotionTick(); }, 0.01f, true); // wrapped in lambda due to some template function class referencing } void UCommonFunctions::ExitSlowMotion(float duration) { - if(SlowMotion::targetDilation == SlowMotion::normalDilation) - return; - - SlowMotion::targetDilation = SlowMotion::normalDilation; - auto GI = UCustomGameInstance::Get(); if(!GI) return; auto world = GI->GetWorld(); + if(FloatIsZero(UGameplayStatics::GetGlobalTimeDilation(world) - SlowMotion::normalDilation)) + return; + + SlowMotion::targetDilation = SlowMotion::normalDilation; world->GetTimerManager().SetTimer(SlowMotion::timer, []() { SlowMotionTick(); }, 0.01f, true); }