Updates & Fixes
# Updates & Fixes
- New Commands: Added `css_bot_place` which teleports a bot to the player's position with optional godmode and translation support.
- Miner (New Skill): Added a new skill that allows for detonating HE grenades near enemies.
- Bomb Abort Support: Introduced `BombAbortplant` support across `ISkill` and event registration; added handlers for aborting plants in Planter, ChillOut, and other skills.
- System (Rework & Optimization):
- Reworked player event dispatching to call `SkillAction` once per distinct active skill, reducing redundant invocations.
- Switched timing logic to use `Server.CurrentTime` (replacing `EngineTime`).
- Added extensive null and validity guards for player and pawn objects.
- Skill-specific Changes:
- AimLock: Fixed vector/validation issues and updated config defaults (cooldown, duration, and offset).
- AreaReaper: Now uses `BombPlantedHere` state and includes `OnTick` alerts.
- ChillOut & Planter: Improved tracking for planting players with center-print and HUD updates.
- HomingNades: Simplified callbacks and fixed detonation timing.
- Muhammed: Tweaked explosion delay handling and reduced friendly fire damage.
- Core & Utils:
- TraceRay: Implemented `CS2TraceRay` for skills to prevent activation through doors or on dropped weapons.
- Dependencies: Bumped `CounterStrikeSharp.API` to 1.0.364 and `MaxMind.Db` to 5.0.0.
- Bug Fixes: Resolved multiple HUD/print update issues and fixed various translation keys.
This commit is contained in:
parent
8634665983
commit
a8890bde6a
22 changed files with 669 additions and 149 deletions
|
|
@ -11,7 +11,7 @@ namespace src.player.skills
|
|||
public class HomingNades : ISkill
|
||||
{
|
||||
private const Skills skillName = Skills.HomingNades;
|
||||
private readonly static ConcurrentDictionary<uint, (Vector, double)> nades = [];
|
||||
private readonly static ConcurrentDictionary<uint, Vector> nades = [];
|
||||
|
||||
public static void LoadSkill()
|
||||
{
|
||||
|
|
@ -30,7 +30,7 @@ namespace src.player.skills
|
|||
foreach (var index in nades.Keys.ToList())
|
||||
{
|
||||
if (!nades.TryGetValue(index, out var data)) continue;
|
||||
(Vector oldPos, double createdTime) = data;
|
||||
Vector oldPos = data;
|
||||
|
||||
var nade = Utilities.GetEntityFromIndex<CBaseCSGrenadeProjectile>((int)index);
|
||||
if (nade == null || !nade.IsValid || nade.AbsOrigin == null)
|
||||
|
|
@ -43,14 +43,13 @@ namespace src.player.skills
|
|||
double distanceMoved = SkillUtils.GetDistance(currentPos, oldPos);
|
||||
Vector calculatedVelocity = CalculateVelocity(nade, nade.TeamNum);
|
||||
|
||||
Server.PrintToChatAll($"Dist: {distanceMoved}, vel: {calculatedVelocity}");
|
||||
bool isZero = calculatedVelocity.IsZero();
|
||||
|
||||
if (distanceMoved < 4 || calculatedVelocity.IsZero())
|
||||
if (distanceMoved < 4 || isZero)
|
||||
{
|
||||
Server.PrintToChatAll($"Short, {Server.TickedTime} -> {createdTime + 3}, {createdTime + 3 - Server.TickedTime}s");
|
||||
|
||||
nade.DetonateTime = (float)createdTime + 3;
|
||||
nade.DetonateTime = isZero ? 0 : nade.CreateTime + 3;
|
||||
Utilities.SetStateChanged(nade, "CBaseGrenade", "m_flDetonateTime");
|
||||
|
||||
nades.TryRemove(index, out _);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -63,7 +62,7 @@ namespace src.player.skills
|
|||
if (speed > maxVelocity)
|
||||
newVelocity *= (maxVelocity / speed);
|
||||
|
||||
nades[index] = (currentPos, createdTime);
|
||||
nades[index] = currentPos;
|
||||
nade.Teleport(null, null, newVelocity);
|
||||
}
|
||||
}
|
||||
|
|
@ -84,9 +83,6 @@ namespace src.player.skills
|
|||
double dist = SkillUtils.GetDistance(nadePos, pawn.AbsOrigin);
|
||||
if (dist < SkillsInfo.GetValue<float>(skillName, "detonationRange"))
|
||||
{
|
||||
nade.DetonateTime = 0;
|
||||
Utilities.SetStateChanged(nade, "CBaseGrenade", "m_flDetonateTime");
|
||||
|
||||
nades.TryRemove(nade.Index, out _);
|
||||
return Vector.Zero;
|
||||
}
|
||||
|
|
@ -134,10 +130,15 @@ namespace src.player.skills
|
|||
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID);
|
||||
if (playerInfo?.Skill != skillName) return;
|
||||
|
||||
grenade.DetonateTime = (float)Server.TickedTime + 6;
|
||||
|
||||
Vector pos = new(grenade.AbsOrigin?.X, grenade.AbsOrigin?.Y, grenade.AbsOrigin?.Z);
|
||||
nades.TryAdd(grenade.Index, (pos, Server.TickedTime));
|
||||
nades.TryAdd(grenade.Index, pos);
|
||||
|
||||
Server.NextWorldUpdate(() =>
|
||||
{
|
||||
if (grenade == null || !grenade.IsValid) return;
|
||||
grenade.DetonateTime += 100f;
|
||||
Utilities.SetStateChanged(grenade, "CBaseGrenade", "m_flDetonateTime");
|
||||
});
|
||||
}
|
||||
|
||||
public static void EnableSkill(CCSPlayerController player)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue