From 14ff69203c62cc296fd5b8de9cddce64d9cc2bd5 Mon Sep 17 00:00:00 2001
From: Luc <89928798+lewcc@users.noreply.github.com>
Date: Thu, 20 Oct 2022 15:13:10 -0400
Subject: [PATCH] Lavaboat now doesn't burn you when you ride it over lava
(#19405)
* Lavaboat now doesn't burn you when you ride it
* Add some more sanity checks
* don't forget to test your code
* as I was saying
* Cleanups
---
.../mining/lavaland/loot/tendril_loot.dm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/code/modules/mining/lavaland/loot/tendril_loot.dm b/code/modules/mining/lavaland/loot/tendril_loot.dm
index 74eeb9f87dd..fb0da4820fb 100644
--- a/code/modules/mining/lavaland/loot/tendril_loot.dm
+++ b/code/modules/mining/lavaland/loot/tendril_loot.dm
@@ -166,6 +166,8 @@
icon = 'icons/obj/lavaland/dragonboat.dmi'
held_key_type = /obj/item/oar
resistance_flags = LAVA_PROOF | FIRE_PROOF
+ /// The last time we told the user that they can't drive on land, so we don't spam them
+ var/last_message_time = 0
/obj/vehicle/lavaboat/relaymove(mob/user, direction)
var/turf/next = get_step(src, direction)
@@ -174,9 +176,24 @@
if(istype(next, /turf/simulated/floor/plating/lava/smooth) || istype(current, /turf/simulated/floor/plating/lava/smooth)) //We can move from land to lava, or lava to land, but not from land to land
..()
else
- to_chat(user, "Boats don't go on land!")
+ if(last_message_time + 1 SECONDS < world.time)
+ to_chat(user, "Boats don't go on land!")
+ last_message_time = world.time
return FALSE
+/obj/vehicle/lavaboat/Destroy()
+ for(var/mob/living/M in buckled_mobs)
+ M.weather_immunities -= "lava"
+ return ..()
+
+/obj/vehicle/lavaboat/user_buckle_mob(mob/living/M, mob/user)
+ M.weather_immunities |= "lava"
+ return ..()
+
+/obj/vehicle/lavaboat/unbuckle_mob(mob/living/buckled_mob, force)
+ . = ..()
+ buckled_mob.weather_immunities -= "lava"
+
/obj/item/oar
name = "oar"
icon = 'icons/obj/vehicles.dmi'