]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improving functions and add them into headers
authorLegendaryGuard <rootuser999@gmail.com>
Fri, 24 Jun 2022 01:30:00 +0000 (03:30 +0200)
committerLegendaryGuard <rootuser999@gmail.com>
Fri, 24 Jun 2022 01:30:00 +0000 (03:30 +0200)
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/sv_turrets.qh
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qh

index 9899b3ea0895367fed3329b2a46ae8c2b45ad820..b05bdb2f76999cba9295e5594d3d4ddb447a9203 100644 (file)
@@ -1005,8 +1005,7 @@ void nade_emerald_boom(entity this)
                                        this.realowner, 
                                        this.origin, 
                                        false, 
-                                       false, 
-                                       1
+                                       false
                                );
 
                                vehspawncount++;
@@ -1027,6 +1026,7 @@ void nade_emerald_boom(entity this)
                                        this.realowner, 
                                        this.realowner, 
                                        this.origin, 
+                                       false,
                                        false, 
                                        false, 
                                        1
index 902ddff3c565507171cdabf1dc8c4ff9fd80bf54..0e049d25a01cbdf0b7beb6c33a3ff22b5eb5152d 100644 (file)
@@ -1416,12 +1416,12 @@ bool turret_initialize(entity this, Turret tur)
        return true;
 }
 
-entity spawnturret (entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid, int moveflag)
+entity spawnturret (entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool invincible, bool removeifinvalid, int moveflag)
 {
        e.spawnflags = TSF_SUSPENDED;
 
        if(!respwn) { e.spawnflags |= TSL_NO_RESPAWN; }
-       // if(invincible) { e.damage_flags |= TFL_DMG_NO; }
+       if(invincible) { e.damage_flags |= TFL_DMG_NO; }
 
        setorigin(e, orig);
        bool allow_any = boolean(turret == "anyrandom");
@@ -1457,22 +1457,21 @@ entity spawnturret (entity e, string turret, Turret tur, entity spawnedby, entit
                                return NULL; // no good
                        }
                        // select a random valid turret type if no valid turret was provided
-                       return spawnturret(e, "random", TUR_Null, spawnedby, own, orig, respwn, removeifinvalid, moveflag);
+                       return spawnturret(e, "random", TUR_Null, spawnedby, own, orig, respwn, invincible, removeifinvalid, moveflag);
                }
        }
 
        e.realowner = spawnedby;
 
-       // TODO: Create a turret .entity moveflag
-       //if(moveflag && e.turret_flags == TUR_FLAG_MOVE)
-       //      e.monster_moveflags = moveflag;
+       if(moveflag)
+               e.turret_flags = TUR_FLAG_MOVE;
 
        if(IS_PLAYER(spawnedby))
        {
                if(teamplay)
                        e.team = spawnedby.team; // colors handled in spawn code
 
-               // TODO: Create a turret .entity moveflag
+               // TODO: Create a "following player" feature when turret has moveflag
                //if(autocvar_g_monsters_owners)
                //      e.monster_follow = own; // using .owner makes the monster non-solid for its master
                
index cdd9e57bfa2e7c1f65b041a2f7a93acbfd8657a6..d1edfeef9fde8ff046b5052c710cd0550c03ecad 100644 (file)
@@ -9,6 +9,7 @@ bool autocvar_g_turrets_reloadcvars;
 float autocvar_g_turrets_targetscan_maxdelay;
 float autocvar_g_turrets_targetscan_mindelay;
 
+entity spawnturret(entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool invincible, bool removeifinvalid, int moveflag);
 entity turret_projectile(entity actor, Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim);
 void turret_projectile_explode(entity this);
 float turret_validate_target(entity e_turret, entity e_target, float validate_flags);
index 83fd479bfe24cbfbcf369affe781b9b4cb0b191d..3e4bf459a124514040ce55eff4be063d34091a3e 100644 (file)
@@ -1292,10 +1292,11 @@ bool vehicle_initialize(entity this, Vehicle info, bool nodrop)
        return true;
 }
 
-entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid, int moveflag)
+entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid)
 {
        e.spawnflags = VHF_MULTISLOT;
-
+       
+       // TODO: Make a respawn option, the following line isn't functional
        if(!respwn) { e.spawnflags |= VHF_ISVEHICLE; }
        setorigin(e, orig);
        bool allow_any = boolean(vehicle == "anyrandom");
@@ -1331,7 +1332,7 @@ entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, en
                                return NULL; // no good
                        }
                        // select a random valid vehicle type if no valid vehicle was provided
-                       return spawnvehicle(e, "random", VEH_Null, spawnedby, own, orig, respwn, removeifinvalid, moveflag);
+                       return spawnvehicle(e, "random", VEH_Null, spawnedby, own, orig, respwn, removeifinvalid);
                }
        }
 
index 95ab1cfa28777bf1479a9966e7cfa06cf0dd4c06..f9f44334702ddd9e8e48c14fdd5c6f3ba8b3b157 100644 (file)
@@ -103,6 +103,7 @@ float vehicles_exit_running;
 
 .float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
 
+entity spawnvehicle(entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid);
 void vehicles_exit(entity vehic, int eject);
 bool vehicle_initialize(entity this, Vehicle info, float nodrop);
 bool vehicle_impulse(entity this, int imp);