GameMode_CityRPG/scripts/functions.cs
// Determines if a raycast hit is a headshot.
// No use on its own, but most weapons use it in isRaycastCritical.
// @bool
function WeaponImage::isRaycastHeadshot(%this, %obj, %slot, %col, %pos, %normal)
{
if(fileName(%col.dataBlock.shapeFile) $= "m.dts")
{
%scaleZ = getWord(%col.getScale(), 2);
if(getWord(%pos, 2) > getWord(%col.getWorldBoxCenter(), 2) - (3.3 * %scaleZ))
{
return true;
}
}
return false;
}