]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qc
Merge branch 'master' into martin-t/maxshotdist
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qc
index 0918130159a737e83e63f5bd076af7320e3dc533..fd9f340f5f1965bdbdd370cde24121517abcdfb1 100644 (file)
@@ -52,6 +52,11 @@ void InitGameplayMode()
        get_mi_min_max(1);
        world.mins = mi_min;
        world.maxs = mi_max;
+       // currently, NetRadiant's limit is 131072 qu for each side
+       // distance from one corner of a 131072qu cube to the opposite corner is approx. 227023 qu
+       // set the distance according to map size but don't go over the limit to avoid issues with float precision
+       // in case somebody makes extremely large maps
+       max_shot_distance = min(230000, vlen(world.maxs - world.mins));
 
        MapInfo_LoadMapSettings(mapname);
        serverflags &= ~SERVERFLAG_TEAMPLAY;