fix: Fix direction change speed hack (#1194)

This commit is contained in:
Kamron Batman 2022-10-16 20:17:18 -07:00 • committed by GitHub
parent 9b2b34f5fb
commit d5416b6dec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 92 additions and 164 deletions

View file

@ -71,11 +71,13 @@ public class Lockpick : Item
if (targeted is ILockpickable lockpickable)
{
var item = lockpickable as Item;
from.Direction = from.GetDirectionTo(item);
if (lockpickable.Locked)
if (lockpickable is Item item && lockpickable.Locked)
{
if (item.RootParent != from)
{
from.Direction = from.GetDirectionTo(item);
}
from.PlaySound(0x241);
new InternalTimer(from, lockpickable, m_Item).Start();