Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Modules/Invisible.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
info.TransmitEntities.Remove(entity);
}

if (Globals.InvisiblePlayers.ContainsKey(player))
{
foreach (var weapon in player!.PlayerPawn.Value.WeaponServices.MyWeapons)

Check warning on line 28 in src/Modules/Invisible.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Dereference of a possibly null reference.

Check warning on line 28 in src/Modules/Invisible.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Dereference of a possibly null reference.
{
info.TransmitEntities.Remove(weapon);
}
}

if (gameRules.GameRules!.WarmupPeriod) return;

var c4s = Utilities.FindAllEntitiesByDesignerName<CC4>("weapon_c4");
Expand All @@ -45,13 +53,13 @@
{
if (!Util.IsPlayerValid(invis.Key)) continue;

var currentWeapon = invis.Key.PlayerPawn.Value.WeaponServices.ActiveWeapon.Get().As<CCSWeaponBase>();

Check warning on line 56 in src/Modules/Invisible.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Dereference of a possibly null reference.

Check warning on line 56 in src/Modules/Invisible.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Dereference of a possibly null reference.

Check warning on line 56 in src/Modules/Invisible.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Dereference of a possibly null reference.
if (currentWeapon.InReload && !invis.Value.HackyReload)
{
var data = Globals.InvisiblePlayers[invis.Key];
data.HackyReload = true;
Globals.InvisiblePlayers[invis.Key] = data;
SetPlayerInvisibleFor(invis.Key, currentWeapon.VData.DisallowAttackAfterReloadStartDuration);

Check warning on line 62 in src/Modules/Invisible.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Dereference of a possibly null reference.
}


Expand Down
Loading