diff --git a/Unreal/Content/PACKS/Blueprints/EasyBallistics/Player/player.uasset b/Unreal/Content/PACKS/Blueprints/EasyBallistics/Player/player.uasset index 33cbe1e..ebe5346 100644 Binary files a/Unreal/Content/PACKS/Blueprints/EasyBallistics/Player/player.uasset and b/Unreal/Content/PACKS/Blueprints/EasyBallistics/Player/player.uasset differ diff --git a/Unreal/Content/PACKS/Blueprints/EasyBallistics/bullet/bullet_tracer.uasset b/Unreal/Content/PACKS/Blueprints/EasyBallistics/bullet/bullet_tracer.uasset index 7ac9297..7873445 100644 Binary files a/Unreal/Content/PACKS/Blueprints/EasyBallistics/bullet/bullet_tracer.uasset and b/Unreal/Content/PACKS/Blueprints/EasyBallistics/bullet/bullet_tracer.uasset differ diff --git a/Unreal/Plugins/EasyBallistics/Binaries/Win64/UnrealEditor-EasyBallistics.dll b/Unreal/Plugins/EasyBallistics/Binaries/Win64/UnrealEditor-EasyBallistics.dll index dd248ad..daf5768 100644 Binary files a/Unreal/Plugins/EasyBallistics/Binaries/Win64/UnrealEditor-EasyBallistics.dll and b/Unreal/Plugins/EasyBallistics/Binaries/Win64/UnrealEditor-EasyBallistics.dll differ diff --git a/Unreal/Plugins/EasyBallistics/Binaries/Win64/UnrealEditor-EasyBallistics.pdb b/Unreal/Plugins/EasyBallistics/Binaries/Win64/UnrealEditor-EasyBallistics.pdb index 6a8dd70..771e148 100644 Binary files a/Unreal/Plugins/EasyBallistics/Binaries/Win64/UnrealEditor-EasyBallistics.pdb and b/Unreal/Plugins/EasyBallistics/Binaries/Win64/UnrealEditor-EasyBallistics.pdb differ diff --git a/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Private/EBBullet.cpp b/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Private/EBBullet.cpp index 4f29094..1ffd53e 100644 --- a/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Private/EBBullet.cpp +++ b/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Private/EBBullet.cpp @@ -64,6 +64,8 @@ void AEBBullet::Step(float DeltaTime) { if (Retrace && CanRetrace) { //time travel + bool SavedOwnerSafe = OwnerSafe; + OwnerSafe = LastTraceOwnerSafe; float remainingTime = LastTraceDelta; int remainingSteps = MaxTracesPerStep; FVector PreviousVelocity = LastTracePrevVelocity; @@ -87,6 +89,7 @@ void AEBBullet::Step(float DeltaTime) { remainingSteps -= 1; if (remainingTime > 0.0f) { sendUpdate = true; }; } while (remainingTime > 0.0f && remainingSteps > 0); + OwnerSafe = SavedOwnerSafe; } CanRetrace = false; diff --git a/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Private/Trace.cpp b/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Private/Trace.cpp index 5630022..5fee6c4 100644 --- a/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Private/Trace.cpp +++ b/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Private/Trace.cpp @@ -95,7 +95,8 @@ float AEBBullet::Trace(FVector start, FVector PreviousVelocity, float delta, TEn #ifdef WITH_EDITOR if (DebugEnabled) { - DrawDebugLine(GetWorld(), start, HitResult.Location, FColor::Blue, false, DebugTrailTime, 0, 3.0f); + FColor DebugColor = FColor::MakeRedToGreenColorFromScalar(Velocity.Size() / MuzzleVelocityMax); + DrawDebugLine(GetWorld(), start, HitResult.Location, DebugColor, false, DebugTrailTime, 0, DebugTrailWidth); }; #endif @@ -178,6 +179,7 @@ float AEBBullet::Trace(FVector start, FVector PreviousVelocity, float delta, TEn LastTraceDelta = delta; LastTracePrevVelocity = PreviousVelocity; LastTraceVelocity = Velocity; + LastTraceOwnerSafe = OwnerSafe; } SetActorLocation(start + TraceDistance); @@ -187,7 +189,8 @@ float AEBBullet::Trace(FVector start, FVector PreviousVelocity, float delta, TEn #ifdef WITH_EDITOR if (DebugEnabled) { - DrawDebugLine(GetWorld(), start, start + TraceDistance, FColor::Magenta, false, DebugTrailTime, 0, 3.0f); + FLinearColor Color = GetDebugColor(Velocity.Size() / ((MuzzleVelocityMin + MuzzleVelocityMax)*0.5f)); + DrawDebugLine(GetWorld(), start, start + TraceDistance, Color.ToFColor(true), false, DebugTrailTime, 0, 0); } } #endif diff --git a/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Public/EBBullet.h b/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Public/EBBullet.h index c131db9..23a5814 100644 --- a/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Public/EBBullet.h +++ b/Unreal/Plugins/EasyBallistics/Source/EasyBallistics/Public/EBBullet.h @@ -208,6 +208,7 @@ private: float LastTraceDelta; FVector LastTraceVelocity; FVector LastTracePrevVelocity; + bool LastTraceOwnerSafe = false; bool IsRecycled;