Skip to content

Commit

Permalink
docs: Add comments to OnPlayerSpawn
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDave1999 committed Aug 9, 2024
1 parent 7d759c2 commit 4954e36
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Application/Players/Weapons/WeaponSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public void OnPlayerSpawn(Player player)
{
var weaponSelection = player.GetComponent<WeaponSelectionComponent>();
WeaponPack selectedWeapons = weaponSelection.SelectedWeapons;
// Don't user foreach for performance reasons.
// OnPlayerSpawn is invoked too often.
for (int i = 0; i < selectedWeapons.Items; i++)
{
IWeapon weapon = selectedWeapons[i];
Expand Down

0 comments on commit 4954e36

Please sign in to comment.