]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix emerald nade while using instagib mutator
authorLegendaryGuard <theasixchan777@gmail.com>
Wed, 21 Jul 2021 23:41:10 +0000 (01:41 +0200)
committerLegendaryGuard <theasixchan777@gmail.com>
Wed, 21 Jul 2021 23:41:10 +0000 (01:41 +0200)
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/nades/nades.qh

index 100a3d1dda3bf6947616e0d96291af5ff8c6b312..688433d9354613be3e8a092d54dc3d9650f22a16 100644 (file)
@@ -241,7 +241,7 @@ void napalm_damage(entity this, float dist, float damage, float edgedamage, floa
                        if(d < dist)
                        {
                                e.fireball_impactvec = p;
-                               RandomSelection_AddEnt(e, 1 / (1 + d), !Fire_IsBurning(e));
+                               RandomSelection_AddEnt(e, 1 / (1 + d), !StatusEffects_active(STATUSEFFECT_Burning, e));
                        }
                }
        if(RandomSelection_chosen_ent)
@@ -807,14 +807,15 @@ void nade_emerald_randomvehicles(entity e, vector org)
 //TODO: turrets must be spawned by owner team, cannot be spawned to attack owner team or both
 void nade_emerald_SpawnTurret(entity ent, vector org, entity tur)
 {
-       FOREACH_CLIENT(IS_PLAYER(it),
-       {
-               if (it.turspawncount < autocvar_g_nades_emerald_turretspawnlimit)
+       //FOREACH_CLIENT(IS_PLAYER(it),
+       //{
+               if (ent.turspawncount < autocvar_g_nades_emerald_turretspawnlimit)
                {
                        //ent = spawn();
-                       ent.owner = it.owner;
-                       ent.realowner = it.realowner;
-                       ent.team = it.team;
+                       //ent.owner = it.owner;
+                       //ent.realowner = it.realowner;
+                       //ent.team = ent.realowner.team;
+                       FOREACH_CLIENT(!IS_OBSERVER(it.realowner), ent.team = it.team;);
                        ent.noalign = true; // don't drop to floor
                        //ent.angles = '0 0 0';
                        //ent.gravity = 1;
@@ -825,8 +826,9 @@ void nade_emerald_SpawnTurret(entity ent, vector org, entity tur)
                        //setthink(ent, turrets_respawn);
                        // fading handled globally
                        //bool turret_initialize(entity this, Turret tur)
+                       //turret_validate_target(ent.realowner, ent.enemy, ent.target_validate_flags);
                        turret_initialize(ent, tur);
-                       it.turspawncount++;
+                       //it.turspawncount++;
                        //PrintToChatAll(sprintf("^1AFTER^7 it.turspawncount: ^3%f", it.turspawncount));
                        //if (!IS_ONGROUND(ent))
                        //      ent.gravity = 1; setorigin(ent, org);
@@ -838,8 +840,8 @@ void nade_emerald_SpawnTurret(entity ent, vector org, entity tur)
                }
                //PrintToChatAll(sprintf("^4tur- ^2it.netname: %s", it.netname));
                //PrintToChatAll(sprintf("^4tur- ^1tur.classname: %s", tur.classname));
-               return;
-       });
+       //      return;
+       //});
 }
 
 //LegendGuard adds random turret spawn function for emerald nade 22-06-2021
@@ -942,7 +944,7 @@ void nade_emerald_dropping(vector org)
        int itemcount = autocvar_g_nades_emerald_spawncount;
        entity e = spawn();
        e.spawnfunc_checked = true;
-       if(!IS_GAMETYPE(CA))
+       if(!IS_GAMETYPE(CA) && !autocvar_g_instagib)
        {
                //int cvar which manages the ONLY dropping per each type of item 14-03-2021
                switch (autocvar_g_nades_emerald_dropitemselect)
@@ -1797,7 +1799,7 @@ void nade_prime(entity this)
        int tntype = this.tandemnade_type;
        string pntype = this.pokenade_type;
 
-       if((this.items & ITEM_Strength.m_itemid) && autocvar_g_nades_bonus_onstrength)
+       if(StatusEffects_active(STATUSEFFECT_Strength, this) && autocvar_g_nades_bonus_onstrength)
                ntype = STAT(NADE_BONUS_TYPE, this);
        else if (STAT(NADE_BONUS, this) >= 1)
        {
index b72bb50961662a0a7e8c9577a767f02f8c0a116a..7daa62415f6f22b8670f05e98fbb8261c1f23f05 100644 (file)
@@ -75,7 +75,7 @@ float autocvar_g_nades_emerald_fountain_lifetime = 1; //if much time, fountain w
 bool autocvar_g_nades_emerald_powerupjetpack_randomdrop = 0;
 int autocvar_g_nades_emerald_dropitemselect = 0; //admin/user selects which item wants to drop in-game, if not will be random
 int autocvar_g_nades_emerald_vehiclespawnlimit = 6; //LegendGuard adds new nade cvar of vehicle spawn count limit for the server 26-06-2021
-int autocvar_g_nades_emerald_turretspawnlimit = 2; // EXPERIMENTAL 26-06-2021
+int autocvar_g_nades_emerald_turretspawnlimit = 4; // EXPERIMENTAL 26-06-2021
 float autocvar_g_nades_ammo_time = 5; //LegendGuard adds new nade cvars 13-02-2021
 float autocvar_g_nades_ammo_rate = 30;
 float autocvar_g_nades_ammo_friend = 1;