-
Notifications
You must be signed in to change notification settings - Fork 451
Quality of life improvements #1038
base: indev
Are you sure you want to change the base?
Conversation
…astTime resolved, added CanMoveWhileChanneling check when disabling movement during cast
… spell changed), preparations for the charging mechanics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments.
return Math.Abs(a) < 1e-6f; | ||
} | ||
|
||
public static float Lerp(float firstFloat, float secondFloat, float by) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this function, but it isn't clear generally. Please add a comment like "Calculation the point between firstFloat and secondFloat with by marking the affinity".
public static float DistanceSquared(this Vector2 value1, Vector2 value2) | ||
{ | ||
float x = value1.X - value2.X; | ||
float y = value1.Y - value2.Y; | ||
return (x * x) + (y * y); | ||
} | ||
|
||
public static Vector2 Rotated(this Vector2 vector2, float angle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a comment if this is clockwise or anti-clockwise (I think this is anti-clockwise???). [I know that you didn't write this function, but it may be useful to know what is the direction of the rotation]
@@ -13,6 +13,7 @@ public interface IChampion : IObjAiBase | |||
int Skin { get; } | |||
IChampionStats ChampStats { get; } | |||
byte SkillPoints { get; set; } | |||
int PlayerId { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for adding it?
/// <param name="player">User to send the packe</param> | ||
/// <param name="newSpell"></param> | ||
/// <param name="slot"></param> | ||
void NotifySpellChangeResponse(IChampion player, string newSpell, byte slot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should pass userId
here I think.
@@ -40,6 +40,8 @@ public class Champion : ObjAiBase, IChampion | |||
private uint _playerTeamSpecialId; | |||
private uint _playerHitId; | |||
|
|||
public int PlayerId => (int)_playerId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this PlayerId. It shouldn't be here.
} | ||
}; | ||
|
||
_packetHandlerManager.SendPacket(player.PlayerId, packet.GetBytes(), Channel.CHL_S2C, PacketFlags.Reliable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
player.PlayerId
shouldn't be here. There is a way to go from Champion to userId with PlayerManager
. The champion class shouldn't know about that.
} | ||
catch (Exception) | ||
{ | ||
foreach (var process in System.Diagnostics.Process.GetProcessesByName("League of Legends")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is VERY risky. You can kill the wrong process very easily. Please remove this.
No more exception when restarting the server from VS, possible ExtraCastTime resolved, added CanMoveWhileChanneling check when disabling movement during cast