From 112fd2142d3b50c7baeb028d216046859af9fa18 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Wed, 27 Apr 2022 15:13:50 +0000 Subject: more dodgy maths --- .../mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut index f72573d6..8fdf6d9c 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut @@ -76,6 +76,7 @@ void function RateSpawnpoints_CTF( int checkClass, array spawnpoints, in // dividing dist between flags by 3ish gives a good radius for the initial circle // should this be based on the distance to the frontline? unsure, it probably should be based more on map size than spawn pos anyway float initialRatingRad = flagDist / 2.75 / 2 + float angleBetweenFlags = atan2( ourFlag.GetOrigin().y - theirFlag.GetOrigin().y, ourFlag.GetOrigin().x - theirFlag.GetOrigin().y ) * ( 180 / PI ) foreach ( entity spawnpoint in spawnpoints ) { @@ -90,12 +91,11 @@ void function RateSpawnpoints_CTF( int checkClass, array spawnpoints, in // determine the angles of the lines we need to be within to be rated here // magic number gives roughly ~8deg from right mid to base on glitch float ratingAnglePos = flagDist * 0.0026 - float ratingAngleNeg = flagDist * -0.0026 - ratingAngleNeg = ( ( ( ratingAngleNeg % 360 ) + 360 ) % 360 ) // this is probably shit i just copied a negative modulo func + float ratingAngleNeg = -ratingAnglePos // calc angle between our spawnpoint and frontline, check if it's within the previous 2 angles - float angle = atan2( spawnpoint.GetOrigin().y - frontline.origin.y, spawnpoint.GetOrigin().x - frontline.origin.x ) * ( 180 / PI ) - if ( angle <= ratingAnglePos && angle <= ratingAngleNeg ) + float angle = ( atan2( spawnpoint.GetOrigin().y - frontline.origin.y, spawnpoint.GetOrigin().x - frontline.origin.x ) * ( 180 / PI ) ) - angleBetweenFlags + if ( angle <= ratingAnglePos && angle >= ratingAngleNeg ) // max out at flagDist rating = ( ( 1 - ( dist / flagDist ) ) * 50 ) } -- cgit v1.2.3