]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into martin-t/rpc-acc
authorMartin Taibr <taibr.martin@gmail.com>
Fri, 2 Mar 2018 21:03:20 +0000 (22:03 +0100)
committerMartin Taibr <taibr.martin@gmail.com>
Fri, 2 Mar 2018 21:03:20 +0000 (22:03 +0100)
1  2 
qcsrc/server/g_damage.qc
qcsrc/server/weapons/tracing.qc

diff --combined qcsrc/server/g_damage.qc
index 33dd8b2e25d1e21ed7108a416c10bbeb5d395d2c,3fb000e708072a5af331a984f1d0563ef5afac99..c7a6f2cfb3b179d1452e9f0e88300192f61d722e
@@@ -32,7 -32,7 +32,7 @@@ void UpdateFrags(entity player, int f
        GameRules_scoring_add_team(player, SCORE, f);
  }
  
 -void GiveFrags (entity attacker, entity targ, float f, int deathtype, .entity weaponentity)
 +void GiveFrags(entity attacker, entity targ, float f, int deathtype, .entity weaponentity)
  {
        // TODO route through PlayerScores instead
        if(game_stopped) return;
@@@ -518,7 -518,7 +518,7 @@@ void Ice_Think(entity this
        this.nextthink = time;
  }
  
- void Freeze(entity targ, float freeze_time, float frozen_type, float show_waypoint)
+ void Freeze (entity targ, float revivespeed, float frozen_type, float show_waypoint)
  {
        if(!IS_PLAYER(targ) && !IS_MONSTER(targ)) // only specified entities can be freezed
                return;
        STAT(FROZEN, targ) = frozen_type;
        STAT(REVIVE_PROGRESS, targ) = ((frozen_type == 3) ? 1 : 0);
        SetResourceAmount(targ, RESOURCE_HEALTH, ((frozen_type == 3) ? targ_maxhealth : 1));
-       targ.revive_speed = freeze_time;
+       targ.revive_speed = revivespeed;
        if(targ.bot_attack)
                IL_REMOVE(g_bot_targets, targ);
        targ.bot_attack = false;
+       targ.freeze_time = time;
  
        entity ice = new(ice);
        ice.owner = targ;
                WaypointSprite_Spawn(WP_Frozen, 0, 0, targ, '0 0 64', NULL, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT);
  }
  
 -void Unfreeze (entity targ)
 +void Unfreeze(entity targ)
  {
        if(!STAT(FROZEN, targ))
                return;
        targ.iceblock = NULL;
  }
  
 -void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
 +void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
  {
        float complainteamdamage = 0;
        float mirrordamage = 0;
        }
  }
  
 -float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, 
 +float RadiusDamageForSource(entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe,
                                                                float inflictorselfdamage, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity)
        // Returns total damage applies to creatures
  {
                                                }
  
                                                if(targ == directhitentity || DEATH_ISSPECIAL(deathtype))
 -                                                      Damage (targ, inflictor, attacker, finaldmg, deathtype, weaponentity, nearest, force);
 +                                                      Damage(targ, inflictor, attacker, finaldmg, deathtype, weaponentity, nearest, force);
                                                else
 -                                                      Damage (targ, inflictor, attacker, finaldmg, deathtype | HITTYPE_SPLASH, weaponentity, nearest, force);
 +                                                      Damage(targ, inflictor, attacker, finaldmg, deathtype | HITTYPE_SPLASH, weaponentity, nearest, force);
                                        }
                                }
                        }
        return total_damage_to_creatures;
  }
  
 -float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity)
 +float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity)
  {
 -      return RadiusDamageForSource (inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad, cantbe, mustbe, false, forceintensity, deathtype, weaponentity, directhitentity);
 +      return RadiusDamageForSource(inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad, cantbe, mustbe, false, forceintensity, deathtype, weaponentity, directhitentity);
  }
  
  float Fire_IsBurning(entity e)
index 4f23011595ef657a24a6f595417c4a2a61bd79cc,a3898c627720059dbf6aecb3eef1c29e3a71c5aa..60a5c3ba7011f81c0e6a2ce7ff9942e7653fed0f
@@@ -30,8 -30,6 +30,6 @@@ void W_SetupShot_Dir_ProjectileSize_Ran
        float nudge = 1; // added to traceline target and subtracted from result  TOOD(divVerent): do we still need this? Doesn't the engine do this now for us?
        float oldsolid = ent.dphitcontentsmask;
        Weapon wep = DEATH_WEAPONOF(deathtype);
-     if (wep == WEP_Null)
-       wep = ent.(weaponentity).m_weapon; // TODO: don't fall back, if the attack isn't a weapon we don't want it to affect the user's held weapon!
        if(!IS_CLIENT(ent))
                antilag = false; // no antilag for non-clients!
        if (IS_PLAYER(ent) && (wep.spawnflags & WEP_FLAG_PENETRATEWALLS))
                ent.punchangle_x = recoil * -1;
  
        if (snd != SND_Null) {
 -              sound (ent, chan, snd, (W_DualWielding(ent) ? VOL_BASE * 0.7 : VOL_BASE), ATTN_NORM);
 +              sound(ent, chan, snd, (W_DualWielding(ent) ? VOL_BASE * 0.7 : VOL_BASE), ATTN_NORM);
                W_PlayStrengthSound(ent);
        }
  
@@@ -418,10 -416,10 +416,10 @@@ void fireBullet(entity this, .entity we
                        yoda = 0;
                        MUTATOR_CALLHOOK(FireBullet_Hit, this, hit, start, end, damage, this.(weaponentity));
                        damage = M_ARGV(4, float);
-                       float g = accuracy_isgooddamage(this, hit);
+                       bool gooddamage = accuracy_isgooddamage(this, hit);
                        Damage(hit, this, this, damage * solid_penetration_left, dtype, weaponentity, start, force * dir * solid_penetration_left);
                        // calculate hits for ballistic weapons
-                       if(g)
+                       if(gooddamage)
                        {
                                // do not exceed 100%
                                float added_damage = min(damage - total_damage, damage * solid_penetration_left);