Skip to content

Commit

Permalink
Passing thrown datum through end_throw().
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 authored and comma committed Jan 30, 2025
1 parent b325b52 commit a2c9d93
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions code/controllers/subsystems/throwing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SUBSYSTEM_DEF(throwing)
continue
if (QDELETED(TT))
if(!QDELETED(AM))
AM.end_throw()
AM.end_throw(TT)
processing -= AM
if (MC_TICK_CHECK)
return
Expand Down Expand Up @@ -103,7 +103,7 @@ SUBSYSTEM_DEF(throwing)

/datum/thrownthing/Destroy()
SSthrowing.processing -= thrownthing
thrownthing.end_throw()
thrownthing.end_throw(src)
thrownthing = null
target = null
thrower = null
Expand Down Expand Up @@ -192,7 +192,7 @@ SUBSYSTEM_DEF(throwing)
if(!QDELETED(thrownthing))
thrownthing.fall()

thrownthing.end_throw()
thrownthing.end_throw(src)
qdel(src)

/datum/thrownthing/proc/hit_atom(atom/A)
Expand Down
2 changes: 1 addition & 1 deletion code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@
appearance_flags &= ~remove_flags
return old_appearance != appearance_flags

/atom/movable/proc/end_throw()
/atom/movable/proc/end_throw(datum/thrownthing/TT)
throwing = null

/atom/movable/proc/reset_movement_delay()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/__item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@
return TRUE
return ..()

/obj/item/end_throw()
/obj/item/end_throw(datum/thrownthing/TT)
. = ..()
squash_item()

Expand Down
15 changes: 9 additions & 6 deletions code/modules/mob_holder/_holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
icon = initial(icon)

/obj/item/holder/Exited(atom/movable/am, atom/new_loc)
am.vis_flags = initial(am.vis_flags)
if(!(locate(/mob) in contents))
am.vis_flags = initial(am.vis_flags)
. = ..()

/obj/item/holder/proc/destroy_all()
Expand All @@ -72,15 +73,15 @@
update_state()

/obj/item/holder/dropped()
..()
. = ..()
update_state(1)

/obj/item/holder/throw_impact(atom/hit_atom, datum/thrownthing/TT)
..()
. = ..()
update_state(1)

/obj/item/holder/proc/update_state(var/delay)
set waitfor = 0
set waitfor = FALSE

for(var/mob/M in contents)
unregister_all_movement(last_holder, M)
Expand All @@ -97,11 +98,13 @@
mob_container.dropInto(loc)
M.reset_view()
qdel(src)
else if(last_holder != loc)
return

if(last_holder != loc)
for(var/mob/M in contents)
register_all_movement(loc, M)
update_icon()
last_holder = loc
last_holder = loc

/obj/item/holder/onDropInto(var/atom/movable/AM)
if(ismob(loc)) // Bypass our holding mob and drop directly to its loc
Expand Down

0 comments on commit a2c9d93

Please sign in to comment.