aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-04-27 01:11:20 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-04-27 01:11:20 +0000
commit6372e71c27fc208074f45186d96a8ae346cffe01 (patch)
tree09112227491577c62c28e69a9557ce5fd21d0bee
parent42c982500f06d04ac87fe9a6030d26f83be089c1 (diff)
downloadNorthstarMods-6372e71c27fc208074f45186d96a8ae346cffe01.tar.gz
NorthstarMods-6372e71c27fc208074f45186d96a8ae346cffe01.zip
fix some slightly fucked maths
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut4
1 files changed, 2 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
index cca446d2..67d8d530 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
@@ -84,7 +84,7 @@ void function RateSpawnpoints_CTF( int checkClass, array<entity> spawnpoints, in
// assume 150 is the max possible rating, with a range of 50-150 if within the initial rating radius, and 0-50 outside of it
float dist = Distance2D( spawnpoint.GetOrigin(), frontline.origin )
if ( dist <= initialRatingRad )
- rating = 50 + ( ( ( initialRatingRad / dist ) - initialRatingRad ) * 100 )
+ rating = 50 + ( ( 1 - ( dist / initialRatingRad ) ) * 100 )
else
{
// determine the angles of the lines we need to be within to be rated here
@@ -97,7 +97,7 @@ void function RateSpawnpoints_CTF( int checkClass, array<entity> spawnpoints, in
float angle = atan2( spawnpoint.GetOrigin().y - frontline.origin.y, spawnpoint.GetOrigin().x - frontline.origin.x ) * ( 180 / PI )
if ( angle <= ratingAnglePos && angle <= ratingAngleNeg )
// max out at flagDist
- rating = ( ( ( flagDist / dist ) - flagDist ) * 50 )
+ rating = ( ( 1 - ( dist / flagDist ) ) * 50 )
}
spawnpoint.CalculateRating( checkClass, player.GetTeam(), rating, rating > 0 ? rating * 0.25 : rating )