avoid unneccessary float calculations and conversions
This commit is contained in:
@@ -75,7 +75,7 @@ namespace OpenRA.Traits
|
|||||||
|
|
||||||
var oldState = this.DamageState;
|
var oldState = this.DamageState;
|
||||||
/* apply the damage modifiers, if we have any. */
|
/* apply the damage modifiers, if we have any. */
|
||||||
var modifier = (float)self.TraitsImplementing<IDamageModifier>()
|
var modifier = self.TraitsImplementing<IDamageModifier>()
|
||||||
.Concat(self.Owner.PlayerActor.TraitsImplementing<IDamageModifier>())
|
.Concat(self.Owner.PlayerActor.TraitsImplementing<IDamageModifier>())
|
||||||
.Select(t => t.GetDamageModifier(attacker, warhead)).Product();
|
.Select(t => t.GetDamageModifier(attacker, warhead)).Product();
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
|
|
||||||
var capturesInfo = self.Info.Traits.Get<CapturesInfo>();
|
var capturesInfo = self.Info.Traits.Get<CapturesInfo>();
|
||||||
var health = target.Trait<Health>();
|
var health = target.Trait<Health>();
|
||||||
int damage = (int)(0.25 * health.MaxHP);
|
int damage = health.MaxHP / 4;
|
||||||
|
|
||||||
// Need to be next to building, TODO: stop capture when going away
|
// Need to be next to building, TODO: stop capture when going away
|
||||||
var mobile = self.Trait<Mobile>();
|
var mobile = self.Trait<Mobile>();
|
||||||
|
|||||||
Reference in New Issue
Block a user