diff --git a/code/modules/vehicles/_hitbox.dm b/code/modules/vehicles/_hitbox.dm index 44e71bf9126..592dc877271 100644 --- a/code/modules/vehicles/_hitbox.dm +++ b/code/modules/vehicles/_hitbox.dm @@ -100,13 +100,20 @@ SIGNAL_HANDLER if(!HAS_TRAIT(AM, TRAIT_TANK_DESANT)) return - if(locate(src) in AM.loc) //Î'd cut the locate but for some reason it wdoesnt work lol + if(AM.loc in locs) return - REMOVE_TRAIT(AM, TRAIT_TANK_DESANT, VEHICLE_TRAIT) AM.layer = LAZYACCESS(tank_desants, AM) LAZYREMOVE(tank_desants, AM) - UnregisterSignal(AM, COMSIG_QDELETING) root.remove_desant(AM) + UnregisterSignal(AM, COMSIG_QDELETING) + var/obj/hitbox/new_hitbox = locate(/obj/hitbox) in AM.loc //walking onto another vehicle + if(!new_hitbox) + REMOVE_TRAIT(AM, TRAIT_TANK_DESANT, VEHICLE_TRAIT) + return + LAZYSET(new_hitbox.tank_desants, AM, AM.layer) + new_hitbox.RegisterSignal(AM, COMSIG_QDELETING, PROC_REF(on_desant_del)) + AM.layer = ABOVE_MOB_PLATFORM_LAYER //we set it separately so the original layer is recorded + new_hitbox.root.add_desant(AM) ///cleanup riders on deletion /obj/hitbox/proc/on_desant_del(datum/source)