]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
get rid of some NOT_S, far from all done yet
authorRudolf Polzer <divverent@xonotic.org>
Thu, 3 Jan 2013 19:54:59 +0000 (20:54 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 3 Jan 2013 19:54:59 +0000 (20:54 +0100)
qcsrc/server/bot/bot.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/t_teleporters.qc

index bd23e890356c3ca1b4e7fc1e295d60ff1df93b61..851a1d9fcf0a1c31aa786cf6c12d97d3daf34894 100644 (file)
@@ -135,11 +135,8 @@ void bot_setnameandstuff()
        else
        {
                RandomSelection_Init();
-               for(;;)
+               while((readfile = fgets(file)))
                {
-                       readfile = fgets(file);
-                       if(!readfile)
-                               break;
                        if(substring(readfile, 0, 2) == "//")
                                continue;
                        if(substring(readfile, 0, 1) == "#")
index cf5ec278b2ec503aa1b2d0b9081d26dba824df02..0766ab0466dbe24fc9ae2bed9ecb2ce529eeef5d 100644 (file)
@@ -375,12 +375,8 @@ float waypoint_load_links()
                return FALSE;
        }
 
-       while (1)
+       while ((s = fgets(file)))
        {
-               s = fgets(file);
-               if (!s)
-                       break;
-
                tokens = tokenizebyseparator(s, "*");
 
                if (tokens!=2)
@@ -473,12 +469,8 @@ void waypoint_load_links_hardwired()
                return;
        }
 
-       for (;;)
+       while ((s = fgets(file)))
        {
-               s = fgets(file);
-               if (!s)
-                       break;
-
                if(substring(s, 0, 2)=="//")
                        continue;
 
@@ -687,18 +679,15 @@ float waypoint_loadall()
        file = fopen(filename, FILE_READ);
        if (file >= 0)
        {
-               while (1)
+               while ((s = fgets(file)))
                {
-                       s = fgets(file);
-                       if (!s)
-                               break;
                        m1 = stov(s);
                        s = fgets(file);
-                       if (!s)
+                       if not(s)
                                break;
                        m2 = stov(s);
                        s = fgets(file);
-                       if (!s)
+                       if not(s)
                                break;
                        fl = stof(s);
                        waypoint_spawn(m1, m2, fl);
index 8698b1753884f7e06e23ea4dd0890f41ee0af179..8d8c0328ec6abed9d4e4e7c7d516fb4249faf260 100644 (file)
@@ -2350,7 +2350,7 @@ string MapVote_Suggest(string m)
        if(mapvote_initialized)
                return "Can't suggest - voting is already in progress!";
        m = MapInfo_FixName(m);
-       if(!m)
+       if not(m)
                return "The map you suggested is not available on this server.";
        if(!autocvar_g_maplist_votable_suggestions_override_mostrecent)
                if(Map_IsRecent(m))
index ffbc74448e518f0cf47d38645dade5d2de906327..efb73540672df091703c6649b2aa90e7862ffb2b 100644 (file)
@@ -428,7 +428,7 @@ string formatmessage(string msg)
                        else replacement = "batteries"; // ;)
                } else if (escape == "x") {
                        replacement = cursor_ent.netname;
-                       if (!replacement || !cursor_ent)
+                       if (replacement == "" || !cursor_ent)
                                replacement = "nothing";
                } else if (escape == "s")
                        replacement = ftos(vlen(self.velocity - self.velocity_z * '0 0 1'));
index 2cfdd8a7720f5bf665d22ed5d7916da177375887..9a17d90c0c53bac0a71e9d2187f057f89add046a 100644 (file)
@@ -325,7 +325,7 @@ void spawnfunc_trigger_teleport (void)
        // this must be called to spawn the teleport waypoints for bots
        InitializeEntity(self, teleport_findtarget, INITPRIO_FINDTARGET);
 
-       if (!self.target)
+       if (self.target == "")
        {
                objerror ("Teleporter with no target");
                return;