Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Conversation

cntseesharp
Copy link

No more exception when restarting the server from VS, possible ExtraCastTime resolved, added CanMoveWhileChanneling check when disabling movement during cast

…astTime resolved, added CanMoveWhileChanneling check when disabling movement during cast
@cntseesharp cntseesharp marked this pull request as ready for review January 26, 2021 23:56
Copy link
Contributor

@danil179 danil179 left a 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)
Copy link
Contributor

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)
Copy link
Contributor

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; }
Copy link
Contributor

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);
Copy link
Contributor

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;
Copy link
Contributor

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);
Copy link
Contributor

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"))
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants