From df8f49fe4c8d6ba1fb863cf00cf4213ad91a2c24 Mon Sep 17 00:00:00 2001
From: BaraBara <96526791+BaraBarax@users.noreply.github.com>
Date: Tue, 12 Nov 2024 18:59:31 +0500
Subject: [PATCH] fix(snowbike): engine fixes
#12953
---
code/modules/vehicles/bike.dm | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm
index 53e9f000913..7dbc69caee2 100644
--- a/code/modules/vehicles/bike.dm
+++ b/code/modules/vehicles/bike.dm
@@ -86,6 +86,7 @@
if(!engine)
return
engine.forceMove(get_turf(src))
+ engine = null
if(trail)
trail.stop()
qdel(trail)
@@ -106,29 +107,33 @@
/obj/vehicle/bike/insert_cell(obj/item/cell/C, mob/living/carbon/human/H)
return
-/obj/vehicle/bike/attackby(obj/item/W as obj, mob/user as mob)
+/obj/vehicle/bike/attackby(obj/item/W, mob/user)
if(open)
if(istype(W, /obj/item/engine))
if(engine)
to_chat(user, "There is already an engine block in \the [src].")
- return 1
+ return TRUE
+
user.visible_message("\The [user] installs \the [W] into \the [src].")
- load_engine(W)
- return
+ load_engine(W, user)
+ return TRUE
+
else if(engine && engine.attackby(W,user))
- return 1
+ return TRUE
+
else if(isCrowbar(W) && engine)
to_chat(user, "You pop out \the [engine] from \the [src].")
unload_engine()
- return 1
+ return TRUE
+
return ..()
-/obj/vehicle/bike/MouseDrop_T(atom/movable/C, mob/user as mob)
+/obj/vehicle/bike/MouseDrop_T(atom/movable/C, mob/user)
if(!load(C))
to_chat(user, " You were unable to load \the [C] onto \the [src].")
return
-/obj/vehicle/bike/attack_hand(mob/user as mob)
+/obj/vehicle/bike/attack_hand(mob/user)
if(user == load)
unload(load)
to_chat(user, "You unbuckle yourself from \the [src]")