From 9138521e15c9d0bb05cc513aee75635cba844147 Mon Sep 17 00:00:00 2001 From: dasschaf Date: Fri, 31 Jul 2020 13:49:43 +0200 Subject: [PATCH] added prelimiary collision detection --- Modes/Drift2020.Script.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Modes/Drift2020.Script.txt b/Modes/Drift2020.Script.txt index d4d7bbd..f2ae580 100644 --- a/Modes/Drift2020.Script.txt +++ b/Modes/Drift2020.Script.txt @@ -241,11 +241,10 @@ declare K_PlayerInfo[] G_PlayerInfo; declare Real Speed = Player.Speed; // crash detection - if (MathLib::Abs(Speed - G_PlayerInfo[PId]) > 15) - { - // collision! - ResetOngoingSkid(PId, S_CollisionPenalty); - } + if (MathLib::Abs(Speed - G_PlayerInfo[PId].LastTickSpeed) > 15) + ResetOngoingSkid(PId, S_CollisionPenalty); // collision! + G_PlayerInfo[PId].LastTickSpeed = Speed; // write new speed + // score relevant information declare Real SkidAngle; //<- radians, 3.14 == 180° turned skiddderidoo