Skip to content

Commit

Permalink
fix(snowbike): engine fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BaraBarax authored Nov 12, 2024
1 parent 619c6c5 commit df8f49f
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions code/modules/vehicles/bike.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
if(!engine)
return
engine.forceMove(get_turf(src))
engine = null
if(trail)
trail.stop()
qdel(trail)
Expand All @@ -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, "<span class='warning'>There is already an engine block in \the [src].</span>")
return 1
return TRUE

user.visible_message("<span class='warning'>\The [user] installs \the [W] into \the [src].</span>")
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, "<span class='warning'> You were unable to load \the [C] onto \the [src].</span>")
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]")
Expand Down

0 comments on commit df8f49f

Please sign in to comment.