]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapinfo.qc
Network impulse triggers
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapinfo.qc
index 914e1dee591a7045f3024859dfe813658e25ae1c..c3f15d1937e4963b06a1f6343c0d896c6ac44ce4 100644 (file)
@@ -272,7 +272,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        mapMins = '0 0 0';
        mapMaxs = '0 0 0';
 
-       for(0;;)
+       for (;;)
        {
                if (!((s = fgets(fh))))
                        break;
@@ -310,12 +310,12 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
                        if(k == "origin")
                        {
                                o = stov(strcat("'", v, "'"));
-                               mapMins_x = min(mapMins.x, o.x);
-                               mapMins_y = min(mapMins.y, o.y);
-                               mapMins_z = min(mapMins.z, o.z);
-                               mapMaxs_x = max(mapMaxs.x, o.x);
-                               mapMaxs_y = max(mapMaxs.y, o.y);
-                               mapMaxs_z = max(mapMaxs.z, o.z);
+                               mapMins.x = min(mapMins.x, o.x);
+                               mapMins.y = min(mapMins.y, o.y);
+                               mapMins.z = min(mapMins.z, o.z);
+                               mapMaxs.x = max(mapMaxs.x, o.x);
+                               mapMaxs.y = max(mapMaxs.y, o.y);
+                               mapMaxs.z = max(mapMaxs.z, o.z);
                        }
                        else if(k == "race_place")
                        {
@@ -806,7 +806,7 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                                print("Map ", pFilename, " references not existing config file ", s, "\n");
                        else
                        {
-                               for(0;;)
+                               for (;;)
                                {
                                        if (!((s = fgets(fh))))
                                                break;
@@ -949,7 +949,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        {
                                n = tokenize_console(cvar_string("g_cdtracks_remaplist"));
                                s = strcat(" ", cvar_string("g_cdtracks_dontusebydefault"), " ");
-                               for(0;;)
+                               for (;;)
                                {
                                        i = floor(random() * n);
                                        if(strstrofs(s, strcat(" ", argv(i), " "), 0) < 0)
@@ -997,7 +997,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
        }
 
        _MapInfo_Map_Reset();
-       for(0;;)
+       for (;;)
        {
                if (!((s = fgets(fh))))
                        break;
@@ -1090,12 +1090,12 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                                                print("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs\n");
                                        else
                                        {
-                                               MapInfo_Map_mins_x = a;
-                                               MapInfo_Map_mins_y = b;
-                                               MapInfo_Map_mins_z = c;
-                                               MapInfo_Map_maxs_x = d;
-                                               MapInfo_Map_maxs_y = e;
-                                               MapInfo_Map_maxs_z = f;
+                                               MapInfo_Map_mins.x = a;
+                                               MapInfo_Map_mins.y = b;
+                                               MapInfo_Map_mins.z = c;
+                                               MapInfo_Map_maxs.x = d;
+                                               MapInfo_Map_maxs.y = e;
+                                               MapInfo_Map_maxs.z = f;
                                        }
                                }
                        }
@@ -1287,11 +1287,11 @@ float MapInfo_CheckMap(string s) // returns 0 if the map can't be played with th
        return r;
 }
 
-void MapInfo_SwitchGameType(float t)
+void MapInfo_SwitchGameType(int t)
 {
-       entity e;
-       for(e = MapInfo_Type_first; e; e = e.enemy)
+       for (entity e = MapInfo_Type_first; e; e = e.enemy) {
                cvar_set(e.netname, (t == e.items) ? "1" : "0");
+       }
 }
 
 void MapInfo_LoadMap(string s, float reinit)
@@ -1415,7 +1415,7 @@ void MapInfo_Shutdown()
        }
 }
 
-float MapInfo_ForbiddenFlags()
+int MapInfo_ForbiddenFlags()
 {
        int f = MAPINFO_FLAG_FORBIDDEN;
 
@@ -1430,7 +1430,7 @@ float MapInfo_ForbiddenFlags()
        return f;
 }
 
-float MapInfo_RequiredFlags()
+int MapInfo_RequiredFlags()
 {
        int f = 0;