diff options
author | archshift <admin@archshift.com> | 2014-06-13 11:41:43 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-06-17 20:39:22 +0200 |
commit | 9e8361976b6b0dc4c62ef48a4744ba1f59fe4346 (patch) | |
tree | f474d56be32cc0d830b95f0d1283d8b1ee43b212 /src/Entities/Pawn.cpp | |
parent | Changed the AddEntityEffect() params for easier calls. (diff) | |
download | cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar.gz cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar.bz2 cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar.lz cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar.xz cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar.zst cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.zip |
Diffstat (limited to 'src/Entities/Pawn.cpp')
-rw-r--r-- | src/Entities/Pawn.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp index ec829f6f8..2986799b7 100644 --- a/src/Entities/Pawn.cpp +++ b/src/Entities/Pawn.cpp @@ -61,15 +61,25 @@ void cPawn::KilledBy(cEntity * a_Killer) -void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, int a_EffectDurationTicks, short a_EffectIntensity, double a_DistanceModifier) +void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, int a_EffectDurationTicks, short a_EffectIntensity, cPawn * a_User, double a_DistanceModifier) +{ + AddEntityEffect(a_EffectType, cEntityEffect(a_EffectDurationTicks, a_EffectIntensity, a_User, a_DistanceModifier)); +} + + + + + +void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect a_Effect) { if (a_EffectType == cEntityEffect::effNoEffect) { return; } - m_EntityEffects[a_EffectType] = cEntityEffect(a_EffectDurationTicks, a_EffectIntensity, this, a_DistanceModifier); - m_World->BroadcastEntityEffect(*this, a_EffectType, a_EffectIntensity, (short)(a_EffectDurationTicks * a_DistanceModifier)); + a_Effect.SetDuration(a_Effect.GetDuration() * a_Effect.GetDistanceModifier()); + m_EntityEffects[a_EffectType] = a_Effect; + m_World->BroadcastEntityEffect(*this, a_EffectType, a_Effect.GetIntensity(), a_Effect.GetDuration()); } |