From 501662a7d77d7fe56f687e30db27f27b5e85185d Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Wed, 30 Oct 2024 03:21:47 +0700 Subject: [PATCH] Fix harpoon badly attaching to some static meshes Just needed to add proper computation of relative location, that takes into account mesh's own rotation. --- sources/Weapons/NiceBullet.uc | 2 +- sources/Weapons/NiceProjectileSpawner.uc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/Weapons/NiceBullet.uc b/sources/Weapons/NiceBullet.uc index 8e03861..216ee99 100644 --- a/sources/Weapons/NiceBullet.uc +++ b/sources/Weapons/NiceBullet.uc @@ -710,7 +710,7 @@ function Stick(Actor target, Vector hitLocation) { expData.affectedByScream = charAffectedByScream; if (!target.IsA('NiceMonster')) { - hitLocation -= target.location; + hitLocation = (hitLocation - target.location) << target.rotation; boneStick = 'None'; resultTarget = target; } else { diff --git a/sources/Weapons/NiceProjectileSpawner.uc b/sources/Weapons/NiceProjectileSpawner.uc index 5334af4..a8ee953 100644 --- a/sources/Weapons/NiceProjectileSpawner.uc +++ b/sources/Weapons/NiceProjectileSpawner.uc @@ -259,6 +259,7 @@ static function SpawnStuckProjectile( } else { spawnedBullet.SetBase(base); spawnedBullet.SetRelativeLocation(shift); + spawnedBullet.SetRelativeRotation(direction - base.rotation); } }