From 3d16e3045af39664ecb4c0824a52dfedd6958d73 Mon Sep 17 00:00:00 2001 From: slavidodo Date: Tue, 14 Apr 2020 05:31:38 +0200 Subject: [PATCH] Remove unnecessary todo and fix missile effects --- .../Assets/Scripts/Core/Appearances/MissleInstance.cs | 8 +++++--- .../Assets/Scripts/Core/WorldMap/WorldMapStorage.cs | 9 ++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/OpenTibia/Assets/Scripts/Core/Appearances/MissleInstance.cs b/OpenTibia/Assets/Scripts/Core/Appearances/MissleInstance.cs index a3e6f34..02006ee 100644 --- a/OpenTibia/Assets/Scripts/Core/Appearances/MissleInstance.cs +++ b/OpenTibia/Assets/Scripts/Core/Appearances/MissleInstance.cs @@ -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) { diff --git a/OpenTibia/Assets/Scripts/Core/WorldMap/WorldMapStorage.cs b/OpenTibia/Assets/Scripts/Core/WorldMap/WorldMapStorage.cs index 9a8c336..6fa06a5 100644 --- a/OpenTibia/Assets/Scripts/Core/WorldMap/WorldMapStorage.cs +++ b/OpenTibia/Assets/Scripts/Core/WorldMap/WorldMapStorage.cs @@ -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--) { @@ -714,8 +711,6 @@ public void Animate() { } messageBox.RemoveMessages(); - // todo, destroy text mesh in a separate job :) - //messageBox.DestroyTextMesh(); MessageBoxes.RemoveAt(i); LayoutOnscreenMessages = true; }