aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut8
1 files 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<entity> 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<entity> 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 )
}