This commit is contained in:
Juzlus 2026-02-03 07:02:40 +01:00
parent ae13d6a15c
commit 53917a8b4b
62 changed files with 2643 additions and 935 deletions

View file

@ -61,7 +61,7 @@ namespace src.player.skills
{
foreach (var (info, player) in infoList)
{
if (player == null) continue;
if (player == null || !player.IsValid) continue;
foreach (var _player in invisiblePlayers.Keys)
if (player.SteamID != _player.SteamID)
{
@ -72,8 +72,9 @@ namespace src.player.skills
if (entity == null || !entity.IsValid) continue;
info.TransmitEntities.Remove(entity.Index);
var bombIndex = HideBomb(_player);
var bombIndex = GetBombIndex();
if (bombIndex == null) continue;
var bombEntity = Utilities.GetEntityFromIndex<CBaseEntity>((int)bombIndex);
if (bombEntity == null || !bombEntity.IsValid) continue;
info.TransmitEntities.Remove(bombEntity.Index);
@ -124,7 +125,7 @@ namespace src.player.skills
particle.AcceptInput("Start");
}
private static uint? HideBomb(CCSPlayerController player)
private static uint? GetBombIndex()
{
var bombEntities = Utilities.FindAllEntitiesByDesignerName<CC4>("weapon_c4").ToList();
if (bombEntities.Count == 0) return null;
@ -132,15 +133,6 @@ namespace src.player.skills
var bomb = bombEntities.FirstOrDefault();
if (bomb == null) return null;
// if (bomb.OwnerEntity.Index != player.Index) return null;
bomb.EntitySpottedState.Spotted = false;
Utilities.SetStateChanged(bomb, "CCSPlayerPawn", "m_entitySpottedState", Schema.GetSchemaOffset("EntitySpottedState_t", "m_bSpotted"));
for (int i = 0; i < bomb.EntitySpottedState.SpottedByMask.Length; i++)
bomb.EntitySpottedState.SpottedByMask[i] = 0;
Utilities.SetStateChanged(bomb, "CCSPlayerPawn", "m_entitySpottedState", Schema.GetSchemaOffset("EntitySpottedState_t", "m_bSpottedByMask"));
return bomb.Index;
}