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 64807b4..24be944 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
                                || (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);
                                {
                                        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
                        || (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);
                        {
                                announcer_1min = TRUE;
                                Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_1);
index a6dff72..9f5e32e 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))
        
        // 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;
 
        {
                float hitwep;
 
index fba8b7b..293ad37 100644 (file)
@@ -242,7 +242,7 @@ float GetPlayerColorForce(float i)
 
 float GetPlayerColor(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;
                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(!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);
                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]);
 
        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
                return; // no records in the actual race
 
        // clientside personal record
index 2ca411a..a7824a9 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
 #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);
                        return;
 
        makevectors(view_angles);
index e53f99b..a027c07 100644 (file)
@@ -15,7 +15,7 @@ void HUDSetup_Start(entity me, entity btn);
 #ifdef IMPLEMENTATION
 void HUDSetup_Check_Gamestatus(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);
        }
        {
                DialogOpenButton_Click(me, main.hudconfirmDialog);
        }
@@ -100,4 +100,4 @@ void XonoticHUDDialog_fill(entity me)
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
-#endif
\ No newline at end of file
+#endif
index 0409390..dc8dabe 100644 (file)
@@ -299,7 +299,7 @@ void ImpulseCommands (void)
                                                {
                                                        print("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n");
                                                        e.colormod_x = 8;
                                                {
                                                        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;
                                                                ++m;
                                                        e.effects |= EF_NODEPTHTEST | EF_RED;
                                                        ++i;
index 924a38e..44cc46a 100644 (file)
@@ -279,7 +279,7 @@ void ClientCommand_selectteam(float request, float argc)
                                if(IS_CLIENT(self))
                                {
                                        if(teamplay)
                                if(IS_CLIENT(self))
                                {
                                        if(teamplay)
-                                               if not(self.team_forced > 0) 
+                                               if(self.team_forced <= 0)
                                                        if (!lockteams) 
                                                        {
                                                                float selection;
                                                        if (!lockteams) 
                                                        {
                                                                float selection;
index 293676e..7dbafa7 100644 (file)
@@ -93,7 +93,7 @@ void GameCommand_adminmsg(float request, float argc)
                                        client = GetFilteredEntity(t);
                                        accepted = VerifyClientEntity(client, TRUE, FALSE);
                                        
                                        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;
                                        {
                                                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);
                                        
                                        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;
                                        {
                                                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);
                                                
                                                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;
                                                {
                                                        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);
                                                
                                                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;
                                                {
                                                        print("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n"); 
                                                        return;
index 91081b0..c444a96 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."); }
                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
                        {
                        
                        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);
                        
                        
                        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."); }
                        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."); }
                                                
                                                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
                                                {
                                                
                                                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":
                                        {
                                        
                                        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(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
                                                {
 
                                                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."); }
                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
                        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."); }
                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
                        {
                        
                        else // everything went okay, continue changing vote
                        {
index 49aae07..c1298d0 100644 (file)
@@ -1645,7 +1645,7 @@ void adaptor_think2use()
 
 void adaptor_think2use_hittype_splash() // for timed projectile detonation
 {
 
 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();
 }
                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)
 {
 
 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;
                return bits;
 
        float n, f, b, r;
index aee2893..0dc2b2f 100644 (file)
@@ -334,7 +334,7 @@ float PlayerScore_Add(entity player, float scorefield, float score)
        entity s;
 
        if(gameover)
        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
                score = 0;
 
        if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
index 4499f26..a0a7e5f 100644 (file)
@@ -913,7 +913,7 @@ void spawnfunc_vehicle_bumblebee()
        if(autocvar_g_vehicle_bumblebee_health_regen)
                self.vehicle_flags |= VHF_HEALTHREGEN;
 
        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,
                           "Bumblebee", "models/vehicles/bumblebee_body.dpm",
                           "", "models/vehicles/spiderbot_cockpit.dpm", "", "", "tag_viewport",
                           HUD_BUMBLEBEE, BUMB_MIN, BUMB_MAX, FALSE,
index bbcf11c..c4f7b43 100644 (file)
@@ -666,7 +666,7 @@ void spawnfunc_vehicle_racer()
     if(autocvar_g_vehicle_racer_health_regen)
         self.vehicle_flags |= VHF_HEALTHREGEN;
 
     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
              "Wakizashi",
              "models/vehicles/wakizashi.dpm",
              "null", // we need this so tur_head is networked and usable for sounds
index 2472f3a..229bbfe 100644 (file)
@@ -914,7 +914,7 @@ void spawnfunc_vehicle_raptor()
     precache_sound ("vehicles/raptor_speed.wav");
     precache_sound ("vehicles/missile_alarm.wav");
     
     precache_sound ("vehicles/raptor_speed.wav");
     precache_sound ("vehicles/missile_alarm.wav");
     
-    if not (vehicle_initialize(
+    if(!vehicle_initialize(
              "Raptor",
              "models/vehicles/raptor.dpm",
              "",
              "Raptor",
              "models/vehicles/raptor.dpm",
              "",
index 478067c..9b37d3e 100644 (file)
@@ -855,7 +855,7 @@ void spawnfunc_vehicle_spiderbot()
     if(autocvar_g_vehicle_spiderbot_health_regen)
         self.vehicle_flags |= VHF_HEALTHREGEN;
         
     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",
              "Spiderbot",
              "models/vehicles/spiderbot.dpm",
              "models/vehicles/spiderbot_top.dpm",
index f9aa1a0..f1fca41 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(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;
                                trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET ||
                                trace_ent.takedamage == DAMAGE_TARGETDRONE)
             trace_ent = world;
index b9c37cc..dd89ec2 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)
        {
        // 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);
                {
                        // nearest point on the beam
                        beampos = start + dir * bound(0, (msg_entity.origin - start) * dir, length);