Skip to content

Commit

Permalink
Remove unnecessary todo and fix missile effects
Browse files Browse the repository at this point in the history
  • Loading branch information
slavidodo committed Apr 14, 2020
1 parent 4250ea9 commit 3d16e30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 5 additions & 3 deletions OpenTibia/Assets/Scripts/Core/Appearances/MissleInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ public sealed class MissileInstance : AppearanceInstance
public Vector3Int AnimationDelta {
get {
return new Vector3Int {
x = _animationDelta.x + (_target.x - _position.x),
y = _animationDelta.y + (_target.y - _position.y)
} * Constants.FieldSize;
x = _animationDelta.x + (_target.x - _position.x) * Constants.FieldSize,
y = _animationDelta.y + (_target.y - _position.y) * Constants.FieldSize
};
}
}

public MissileInstance(uint id, AppearanceType type, Vector3Int fromPosition, Vector3Int toPosition) : base(id, type) {
Phase = Constants.PhaseAsynchronous;

_animationDelta = new Vector2Int(toPosition.x - fromPosition.x, toPosition.y - fromPosition.y);
if (_animationDelta.x == 0) {
if (_animationDelta.y <= 0) {
Expand Down
9 changes: 2 additions & 7 deletions OpenTibia/Assets/Scripts/Core/WorldMap/WorldMapStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,10 @@ public void Animate() {
if (ticks >= _objectNextUpdate) {
for (int i = _effectsCount - 1; i >= 0; i--) {
var effect = _effects[i];
if (!effect.Animate(ticks)) {
// todo
// destroy textmesh in a separate job
if (!effect.Animate(ticks))
DeleteEffect(i);
} else if (effect is Appearances.MissileInstance missleEffect) {
else if (effect is Appearances.MissileInstance missleEffect)
MoveEffect(missleEffect.Position, i);
}
}

for (int i = Constants.NumFields - 1; i >= 0; i--) {
Expand Down Expand Up @@ -714,8 +711,6 @@ public void Animate() {
}

messageBox.RemoveMessages();
// todo, destroy text mesh in a separate job :)
//messageBox.DestroyTextMesh();
MessageBoxes.RemoveAt(i);
LayoutOnscreenMessages = true;
}
Expand Down

0 comments on commit 3d16e30

Please sign in to comment.