Change explosives mechanics

This commit is contained in:
Anton Tarasenko 2024-04-23 23:24:11 +07:00
commit e79d49ce0d
6 changed files with 65 additions and 123 deletions

View file

@ -681,6 +681,22 @@ simulated function float IsHeadshotClient( Vector Loc,
return 1.0 - (distance / (headRadius * headScale * additionalScale));
return 0.0;
}
// Calculates distance from `location` to this zed's head.
simulated function float GetDistanceToHead(Vector location) {
local Coords headBoneCoords;
local Vector headLocation;
local Vector AToLineOrig;
local Vector lineDir;
if(headBone == '') {
return 0.0;
}
headBoneCoords = GetBoneCoords(headBone);
headLocation =
headBoneCoords.Origin + headHeight * headScale * headBoneCoords.XAxis;
return VSize(location - headLocation);
}
// In case of a future modifications:
// check if it's a player doing damage before relying on it
function ModDamage( out int damage,