]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Manual riddance of remaining "if not".
authorRudolf Polzer <divverent@xonotic.org>
Wed, 30 Oct 2013 12:36:14 +0000 (13:36 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 30 Oct 2013 12:36:14 +0000 (13:36 +0100)
17 files changed:
qcsrc/client/announcer.qc
qcsrc/client/damage.qc
qcsrc/client/hud.qc
qcsrc/client/shownames.qc
qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hud.c
qcsrc/server/cl_impulse.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/scores.qc
qcsrc/server/vehicles/bumblebee.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/w_common.qc

index 64807b4022c2b8bf19236064c0c1b637aee224c8..24be944d288ecb15fe1ef02f8b2f3eb3741317e6 100644 (file)
@@ -106,7 +106,7 @@ void Announcer_Time()
                                || (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft < 300 && warmup_timeleft > 299))
                        {
                                //if we're in warmup mode, check whether there's a warmup timelimit
-                               if not(autocvar_g_warmup_limit == -1 && warmup_stage) 
+                               if(!(autocvar_g_warmup_limit == -1 && warmup_stage))
                                {
                                        announcer_5min = TRUE;
                                        Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_5);
@@ -128,7 +128,7 @@ void Announcer_Time()
                        || (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft < 60))
                {
                        // if we're in warmup mode, check whether there's a warmup timelimit
-                       if not(autocvar_g_warmup_limit == -1 && warmup_stage) 
+                       if(!(autocvar_g_warmup_limit == -1 && warmup_stage))
                        {
                                announcer_1min = TRUE;
                                Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_1);
index a6dff727109d609fc04cd270a9a9878f61880d88..9f5e32e9569a8d59da70dda7b6030975b5186ddb 100644 (file)
@@ -336,7 +336,7 @@ void Ent_DamageInfo(float isNew)
        
        // TODO spawn particle effects and sounds based on w_deathtype
        if(!DEATH_ISSPECIAL(w_deathtype))
-       if not(hitplayer && !rad) // don't show ground impacts for hitscan weapons if a player was hit
+       if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit
        {
                float hitwep;
 
index fba8b7b4fbdd45f4516f3bf6d6fc2c9349778dfe..293ad379e1d9bd3550a3cc20d7895196a1e754b4 100644 (file)
@@ -242,7 +242,7 @@ float GetPlayerColorForce(float i)
 
 float GetPlayerColor(float i)
 {
-       if not(playerslots[i].gotscores) // unconnected
+       if(!playerslots[i].gotscores) // unconnected
                return NUM_SPECTATOR;
        else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
                return NUM_SPECTATOR;
@@ -1133,7 +1133,7 @@ void HUD_Powerups(void)
        {
                if(!autocvar_hud_panel_powerups) return;
                if(spectatee_status == -1) return;
-               if not(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON)) return;
+               if(!(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON))) return;
                if (getstati(STAT_HEALTH) <= 0) return;
 
                strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
@@ -3123,7 +3123,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
        float f; // yet another function has this
        score = me.(scores[ps_primary]);
 
-       if not((scores_flags[ps_primary] & SFL_TIME) && !teamplay) // race/cts record display on HUD
+       if(!(scores_flags[ps_primary] & SFL_TIME) || teamplay) // race/cts record display on HUD
                return; // no records in the actual race
 
        // clientside personal record
index 2ca411a1bbcce18f588cd6223ed9fb0bcc7751ca..a7824a9b75bdcf10647c543d72d8a4fbb62f2c7d 100644 (file)
@@ -19,7 +19,7 @@ void Draw_ShowNames(entity ent)
 #else
        if(ent.sv_entnum == player_localentnum) // ent is me or person i'm spectating
 #endif
-               if not (autocvar_hud_shownames_self && autocvar_chase_active) 
+               if(!(autocvar_hud_shownames_self && autocvar_chase_active))
                        return;
 
        makevectors(view_angles);
index e53f99bc1fec29b5a6b90f46cf30aa51f3c9c585..a027c07017d928f11df7db9f318b66a8acf501b1 100644 (file)
@@ -15,7 +15,7 @@ void HUDSetup_Start(entity me, entity btn);
 #ifdef IMPLEMENTATION
 void HUDSetup_Check_Gamestatus(entity me, entity btn)
 {
-       if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) // we're not in a match, ask the player if they want to start one anyway
+       if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, ask the player if they want to start one anyway
        {
                DialogOpenButton_Click(me, main.hudconfirmDialog);
        }
@@ -100,4 +100,4 @@ void XonoticHUDDialog_fill(entity me)
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
-#endif
\ No newline at end of file
+#endif
index 04093902108fcd7e21683ee86f241c6317a0ead2..dc8dabee6c719861d0c34b98fe880fa762a9c03a 100644 (file)
@@ -299,7 +299,7 @@ void ImpulseCommands (void)
                                                {
                                                        print("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n");
                                                        e.colormod_x = 8;
-                                                       if not(e.effects & EF_NODEPTHTEST) // not already reported before
+                                                       if(!(e.effects & EF_NODEPTHTEST)) // not already reported before
                                                                ++m;
                                                        e.effects |= EF_NODEPTHTEST | EF_RED;
                                                        ++i;
index 924a38e7d70a2cff1ea7b7a124fef883037f0f53..44cc46a02bcd7bad0a07422ec6dc8b11917c9c5e 100644 (file)
@@ -279,7 +279,7 @@ void ClientCommand_selectteam(float request, float argc)
                                if(IS_CLIENT(self))
                                {
                                        if(teamplay)
-                                               if not(self.team_forced > 0) 
+                                               if(self.team_forced <= 0)
                                                        if (!lockteams) 
                                                        {
                                                                float selection;
index 293676eb01ae8f9464e6c0c288e629951f17f063..7dbafa7ab8b747d888e1e06868a3717938463d3a 100644 (file)
@@ -93,7 +93,7 @@ void GameCommand_adminmsg(float request, float argc)
                                        client = GetFilteredEntity(t);
                                        accepted = VerifyClientEntity(client, TRUE, FALSE);
                                        
-                                       if not(accepted > 0) 
+                                       if(accepted <= 0) 
                                        {
                                                print("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n")); 
                                                continue;
@@ -992,7 +992,7 @@ void GameCommand_moveplayer(float request, float argc)
                                        client = GetFilteredEntity(t);
                                        accepted = VerifyClientEntity(client, FALSE, FALSE);
                                        
-                                       if not(accepted > 0) 
+                                       if(accepted <= 0) 
                                        {
                                                print("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n")); 
                                                continue;
@@ -1148,7 +1148,7 @@ void GameCommand_playerdemo(float request, float argc)
                                                client = GetIndexedEntity(argc, 2);
                                                accepted = VerifyClientEntity(client, FALSE, TRUE);
                                                
-                                               if not(accepted > 0) 
+                                               if(accepted <= 0) 
                                                {
                                                        print("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n"); 
                                                        return;
@@ -1164,7 +1164,7 @@ void GameCommand_playerdemo(float request, float argc)
                                                client = GetIndexedEntity(argc, 2);
                                                accepted = VerifyClientEntity(client, FALSE, FALSE);
                                                
-                                               if not(accepted > 0) 
+                                               if(accepted <= 0) 
                                                {
                                                        print("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n"); 
                                                        return;
index 91081b098926e1abea9f07b4d6a99177f73c7b6b..c444a96159aea83625b59453f77fed044b01af68 100644 (file)
@@ -748,7 +748,7 @@ void VoteCommand_abstain(float request, entity caller) // CLIENT ONLY
                case CMD_REQUEST_COMMAND:
                {
                        if (!vote_called) { print_to(caller, "^1No vote called."); }
-                       else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
+                       else if(caller.vote_selection != VOTE_SELECT_NULL && !autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
                        
                        else // everything went okay, continue changing vote
                        {
@@ -786,7 +786,7 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm
                        
                        vote_command = VoteCommand_extractcommand(vote_command, 2, argc);
                        
-                       if not(autocvar_sv_vote_call || !caller) { print_to(caller, "^1Vote calling is not allowed."); }
+                       if(!autocvar_sv_vote_call && caller) { print_to(caller, "^1Vote calling is not allowed."); }
                        else if(!autocvar_sv_vote_gamestart && time < game_starttime) { print_to(caller, "^1Vote calling is not allowed before the match has started."); }
                        else if(vote_called) { print_to(caller, "^1There is already a vote called."); }
                        else if(!spectators_allowed && (caller && !IS_PLAYER(caller))) { print_to(caller, "^1Only players can call a vote."); }
@@ -850,7 +850,7 @@ void VoteCommand_master(float request, entity caller, float argc, string vote_co
                                                
                                                if (!caller.vote_master) { print_to(caller, "^1You do not have vote master privelages."); }
                                                else if (!VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); }
-                                               else if not(VoteCommand_parse(caller, vote_command, strcat(autocvar_sv_vote_commands, " ", autocvar_sv_vote_master_commands), 3, argc)) { print_to(caller, "^1This command is not acceptable, see 'vhelp' for more info."); }
+                                               else if (!VoteCommand_parse(caller, vote_command, strcat(autocvar_sv_vote_commands, " ", autocvar_sv_vote_master_commands), 3, argc)) { print_to(caller, "^1This command is not acceptable, see 'vhelp' for more info."); }
                                                
                                                else // everything went okay, proceed with command
                                                {
@@ -865,9 +865,9 @@ void VoteCommand_master(float request, entity caller, float argc, string vote_co
                                        
                                        case "login":
                                        {
-                                               if not(autocvar_sv_vote_master_password != "") { print_to(caller, "^1Login to vote master is not allowed."); }
+                                               if(autocvar_sv_vote_master_password == "") { print_to(caller, "^1Login to vote master is not allowed."); }
                                                else if(caller.vote_master) { print_to(caller, "^1You are already logged in as vote master."); }
-                                               else if not(autocvar_sv_vote_master_password == argv(3)) { print_to(caller, strcat("Rejected vote master login from ", GetCallerName(caller))); }
+                                               else if(autocvar_sv_vote_master_password != argv(3)) { print_to(caller, strcat("Rejected vote master login from ", GetCallerName(caller))); }
 
                                                else // everything went okay, proceed with giving this player master privilages
                                                {
@@ -935,7 +935,7 @@ void VoteCommand_no(float request, entity caller) // CLIENT ONLY
                case CMD_REQUEST_COMMAND:
                {
                        if (!vote_called) { print_to(caller, "^1No vote called."); }
-                       else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
+                       else if(caller.vote_selection != VOTE_SELECT_NULL && !autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
                        else if(((caller == vote_caller) || caller.vote_master) && autocvar_sv_vote_no_stops_vote) { VoteStop(caller); }
                        
                        else // everything went okay, continue changing vote
@@ -1013,7 +1013,7 @@ void VoteCommand_yes(float request, entity caller) // CLIENT ONLY
                case CMD_REQUEST_COMMAND:
                {
                        if (!vote_called) { print_to(caller, "^1No vote called."); }
-                       else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
+                       else if(caller.vote_selection != VOTE_SELECT_NULL && autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
                        
                        else // everything went okay, continue changing vote
                        {
index 49aae079fa7031dbf2151f4c57a63e788d1942bd..c1298d0e7f0f9853d7da7be2dc3730bdb7d22ae2 100644 (file)
@@ -1645,7 +1645,7 @@ void adaptor_think2use()
 
 void adaptor_think2use_hittype_splash() // for timed projectile detonation
 {
-       if not(self.flags & FL_ONGROUND) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
+       if(!(self.flags & FL_ONGROUND)) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
                self.projectiledeathtype |= HITTYPE_SPLASH;
        adaptor_think2use();
 }
@@ -2336,7 +2336,7 @@ void shockwave_spawn(string m, vector org, float sz, float t1, float t2)
 
 float randombit(float bits)
 {
-       if not(bits & (bits-1)) // this ONLY holds for powers of two!
+       if(!(bits & (bits-1))) // this ONLY holds for powers of two!
                return bits;
 
        float n, f, b, r;
index aee289335d2f5bb4c6a02b146c4d1c2107cd7c04..0dc2b2f00b4f2b79586950f95a2e7fc868140615 100644 (file)
@@ -334,7 +334,7 @@ float PlayerScore_Add(entity player, float scorefield, float score)
        entity s;
 
        if(gameover)
-       if not(g_lms && scorefield == SP_LMS_RANK) // allow writing to this field in intermission as it is needed for newly joining players
+       if(!(g_lms && scorefield == SP_LMS_RANK)) // allow writing to this field in intermission as it is needed for newly joining players
                score = 0;
 
        if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
index 4499f26ae5ceb326b99d89ff4f60746173806b35..a0a7e5ffc6d8a9f6561d1664e3f41e1652808717 100644 (file)
@@ -913,7 +913,7 @@ void spawnfunc_vehicle_bumblebee()
        if(autocvar_g_vehicle_bumblebee_health_regen)
                self.vehicle_flags |= VHF_HEALTHREGEN;
 
-       if not(vehicle_initialize(
+       if(!vehicle_initialize(
                           "Bumblebee", "models/vehicles/bumblebee_body.dpm",
                           "", "models/vehicles/spiderbot_cockpit.dpm", "", "", "tag_viewport",
                           HUD_BUMBLEBEE, BUMB_MIN, BUMB_MAX, FALSE,
index bbcf11c0747b6bfdd4e74ce18016e80c6e732c5c..c4f7b436c81c9d2f756f325ed6133211739eb0a4 100644 (file)
@@ -666,7 +666,7 @@ void spawnfunc_vehicle_racer()
     if(autocvar_g_vehicle_racer_health_regen)
         self.vehicle_flags |= VHF_HEALTHREGEN;
 
-    if not (vehicle_initialize(
+    if(!vehicle_initialize(
              "Wakizashi",
              "models/vehicles/wakizashi.dpm",
              "null", // we need this so tur_head is networked and usable for sounds
index 2472f3a0de1a2d8ec1265edacbfb74945cb76472..229bbfedac6a03b5b5aaa8be152fe1aeb81bae91 100644 (file)
@@ -914,7 +914,7 @@ void spawnfunc_vehicle_raptor()
     precache_sound ("vehicles/raptor_speed.wav");
     precache_sound ("vehicles/missile_alarm.wav");
     
-    if not (vehicle_initialize(
+    if(!vehicle_initialize(
              "Raptor",
              "models/vehicles/raptor.dpm",
              "",
index 478067c8e76a7281c367e92e0c6a8e362eb0baf1..9b37d3e6fd2219eff878e9222df8d206bf600055 100644 (file)
@@ -855,7 +855,7 @@ void spawnfunc_vehicle_spiderbot()
     if(autocvar_g_vehicle_spiderbot_health_regen)
         self.vehicle_flags |= VHF_HEALTHREGEN;
         
-    if not (vehicle_initialize(
+    if(!vehicle_initialize(
              "Spiderbot",
              "models/vehicles/spiderbot.dpm",
              "models/vehicles/spiderbot_top.dpm",
index f9aa1a04c9c2c2e283af87e554c34e3795494fed..f1fca41eb138fd892ac471073c3356aadbac2bdc 100644 (file)
@@ -275,7 +275,7 @@ void vehicles_locktarget(float incr, float decr, float _lock_time)
         if(trace_ent.deadflag != DEAD_NO)
             trace_ent = world;
 
-        if not (trace_ent.vehicle_flags & VHF_ISVEHICLE ||
+        if(!trace_ent.vehicle_flags & VHF_ISVEHICLE ||
                                trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET ||
                                trace_ent.takedamage == DAMAGE_TARGETDRONE)
             trace_ent = world;
index b9c37cc4d582da6e83a703a2a0f2caddc00d3a71..dd89ec2f889cdf5e3d688f340d649e31a47d7107 100644 (file)
@@ -104,7 +104,10 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
        // Find all non-hit players the beam passed close by
        if(deathtype == WEP_MINSTANEX || deathtype == WEP_NEX)
        {
-               FOR_EACH_REALCLIENT(msg_entity) if(msg_entity != self) if(!msg_entity.railgunhit) if not(IS_SPEC(msg_entity) && msg_entity.enemy == self) // we use realclient, so spectators can hear the whoosh too
+               FOR_EACH_REALCLIENT(msg_entity)
+               if(msg_entity != self)
+               if(!msg_entity.railgunhit)
+               if(!(IS_SPEC(msg_entity) && msg_entity.enemy == self)) // we use realclient, so spectators can hear the whoosh too
                {
                        // nearest point on the beam
                        beampos = start + dir * bound(0, (msg_entity.origin - start) * dir, length);