Refactored Health usage to IHealth.
This commit is contained in:
@@ -16,7 +16,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("This actor receives damage from the given weapon when on the specified terrain type.")]
|
||||
class DamagedByTerrainInfo : ConditionalTraitInfo, Requires<HealthInfo>
|
||||
class DamagedByTerrainInfo : ConditionalTraitInfo, Requires<IHealthInfo>
|
||||
{
|
||||
[Desc("Amount of damage received per DamageInterval ticks.")]
|
||||
[FieldLoader.Require] public readonly int Damage = 0;
|
||||
@@ -41,14 +41,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
class DamagedByTerrain : ConditionalTrait<DamagedByTerrainInfo>, ITick, ISync, INotifyAddedToWorld
|
||||
{
|
||||
readonly Health health;
|
||||
readonly IHealth health;
|
||||
|
||||
[Sync] int damageTicks;
|
||||
[Sync] int damageThreshold;
|
||||
|
||||
public DamagedByTerrain(Actor self, DamagedByTerrainInfo info) : base(info)
|
||||
{
|
||||
health = self.Trait<Health>();
|
||||
health = self.Trait<IHealth>();
|
||||
}
|
||||
|
||||
void INotifyAddedToWorld.AddedToWorld(Actor self)
|
||||
|
||||
Reference in New Issue
Block a user