From: Rudolf Polzer Date: Thu, 3 Jan 2013 19:54:59 +0000 (+0100) Subject: get rid of some NOT_S, far from all done yet X-Git-Tag: xonotic-v0.7.0~140 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e0d8a8246842aa6dbf9f15e527a806033b5af35a;p=xonotic%2Fxonotic-data.pk3dir.git get rid of some NOT_S, far from all done yet --- diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index bd23e8903..851a1d9fc 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -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) == "#") diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/waypoints.qc index cf5ec278b..0766ab046 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -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); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 8698b1753..8d8c0328e 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -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)) diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index ffbc74448..efb735406 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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')); diff --git a/qcsrc/server/t_teleporters.qc b/qcsrc/server/t_teleporters.qc index 2cfdd8a77..9a17d90c0 100644 --- a/qcsrc/server/t_teleporters.qc +++ b/qcsrc/server/t_teleporters.qc @@ -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;