Skip to content

Commit

Permalink
Fixes weapon racks signal override (#1685)
Browse files Browse the repository at this point in the history
* Fixes weapon racks signal override

* Update gun_racks.dm

Co-authored-by: Bloop <[email protected]>
  • Loading branch information
Steals-The-PRs and vinylspiders authored Jan 24, 2024
1 parent 12f5af4 commit c3c739d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modular_nova/modules/modular_weapons/code/gun_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
var/matrix/new_matrix = matrix()
if(!being_removed)
new_matrix.Turn(-90)
RegisterSignal(incoming_weapon, COMSIG_ITEM_EQUIPPED, PROC_REF(item_picked_up))
incoming_weapon.transform = new_matrix
RegisterSignal(incoming_weapon, COMSIG_ITEM_EQUIPPED, PROC_REF(item_picked_up))

/// Checks when something is leaving our turf, if its a gun then make sure to reset its transform so its not permanently rotated
/obj/structure/rack/gunrack/proc/on_exit(datum/source, atom/movable/leaving, direction)
Expand All @@ -47,12 +47,12 @@
if(!isgun(leaving))
return
var/obj/item/leaving_item = leaving
rotate_weapon(leaving_item, TRUE)
rotate_weapon(leaving_item, being_removed = TRUE)

/// Handles the guns being picked up to unrotate them
/obj/structure/rack/gunrack/proc/item_picked_up(datum/source, mob/equipper, slot)
SIGNAL_HANDLER

var/obj/item/leaving_item = source
rotate_weapon(leaving_item, TRUE)
rotate_weapon(leaving_item, being_removed = TRUE)
UnregisterSignal(leaving_item, COMSIG_ITEM_EQUIPPED)

0 comments on commit c3c739d

Please sign in to comment.