Change explosives mechanics
This commit is contained in:
parent
08c7d99de9
commit
e79d49ce0d
6 changed files with 65 additions and 123 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue