Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(snowbike): engine fixes #12953

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading