]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
Fix indentation of all the if if else I could find out and add explicit brackets...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / onslaught / sv_onslaught.qc
index 6d719eb977c512997131382e30a0698e0fcd14c0..6ac6c7c4bd29d25dc009b154874764e93773839a 100644 (file)
@@ -27,7 +27,6 @@ float autocvar_g_onslaught_teleport_radius;
 float autocvar_g_onslaught_spawn_choose;
 float autocvar_g_onslaught_click_radius;
 
-void FixSize(entity e);
 entity cam;
 
 // =======================
@@ -114,12 +113,6 @@ void ons_CaptureShield_Spawn(entity generator, bool is_generator)
 // Junk Pile
 // ==========
 
-void setmodel_fixsize(entity e, Model m)
-{
-       setmodel(e, m);
-       FixSize(e);
-}
-
 void onslaught_updatelinks()
 {
        entity l;
@@ -438,7 +431,7 @@ void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker
 
                this.owner.waslinked = this.owner.islinked;
                if(this.owner.model != "models/onslaught/controlpoint_pad.md3")
-                       setmodel_fixsize(this.owner, MDL_ONS_CP_PAD1);
+                       setmodel(this.owner, MDL_ONS_CP_PAD1);
                //setsize(this, '-32 -32 0', '32 32 8');
 
                delete(this);
@@ -578,7 +571,7 @@ void ons_ControlPoint_Icon_BuildThink(entity this)
                this.SendFlags |= CPSF_SETUP;
        }
        if(this.owner.model != MDL_ONS_CP_PAD2.model_str())
-               setmodel_fixsize(this.owner, MDL_ONS_CP_PAD2);
+               setmodel(this.owner, MDL_ONS_CP_PAD2);
 
        if(random() < 0.9 - GetResourceAmount(this, RESOURCE_HEALTH) / this.max_health)
                Send_Effect(EFFECT_RAGE, this.origin + 10 * randomvec(), '0 0 -1', 1);
@@ -686,10 +679,11 @@ void ons_ControlPoint_Touch(entity this, entity toucher)
        int attackable;
 
        if(IS_VEHICLE(toucher) && toucher.owner)
-       if(autocvar_g_onslaught_allow_vehicle_touch)
+       {
+               if (!autocvar_g_onslaught_allow_vehicle_touch)
+                       return;
                toucher = toucher.owner;
-       else
-               return;
+       }
 
        if(!IS_PLAYER(toucher)) { return; }
        if(STAT(FROZEN, toucher)) { return; }
@@ -737,7 +731,7 @@ void ons_ControlPoint_Reset(entity this)
        setthink(this, ons_ControlPoint_Think);
        this.ons_toucher = NULL;
        this.nextthink = time + ONS_CP_THINKRATE;
-       setmodel_fixsize(this, MDL_ONS_CP_PAD1);
+       setmodel(this, MDL_ONS_CP_PAD1);
 
        WaypointSprite_UpdateMaxHealth(this.sprite, 0);
        WaypointSprite_UpdateRule(this.sprite,this.team,SPRITERULE_TEAMPLAY);
@@ -781,7 +775,7 @@ void ons_ControlPoint_Setup(entity cp)
        if(cp.message == "") { cp.message = "a"; }
 
        // appearence
-       setmodel_fixsize(cp, MDL_ONS_CP_PAD1);
+       setmodel(cp, MDL_ONS_CP_PAD1);
 
        // control point placement
        if((cp.spawnflags & 1) || cp.noalign) // don't drop to floor, just stay at fixed location
@@ -1632,6 +1626,11 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe
                                player.angles = '0 1 0' * ( theta * RAD2DEG + 180 );
                                makevectors(player.angles);
                                player.fixangle = true;
+                               if (IS_BOT_CLIENT(player))
+                               {
+                                       player.v_angle = player.angles;
+                                       bot_aim_reset(player);
+                               }
                                player.teleport_antispam = time + autocvar_g_onslaught_teleport_wait;
 
                                if ( tele_effects )
@@ -1718,10 +1717,12 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn)
                for(tmp_entity = ons_worldcplist; tmp_entity; tmp_entity = tmp_entity.ons_worldcpnext)
                {
                        if(SAME_TEAM(tmp_entity, player))
-                       if(random_target)
-                               RandomSelection_AddEnt(tmp_entity, 1, 1);
-                       else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == NULL)
-                               closest_target = tmp_entity;
+                       {
+                               if(random_target)
+                                       RandomSelection_AddEnt(tmp_entity, 1, 1);
+                               else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == NULL)
+                                       closest_target = tmp_entity;
+                       }
                }
 
                if(random_target) { closest_target = RandomSelection_chosen_ent; }