Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Waselon committed Aug 26, 2024
1 parent a04e602 commit 42e01b1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions code/modules/vehicles/_hitbox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 42e01b1

Please sign in to comment.