Skip to content

Commit

Permalink
Merge pull request #3552 from PsyCommando/move-obj-alt-interactions
Browse files Browse the repository at this point in the history
Moved obj alt interactions to file
  • Loading branch information
MistakeNot4892 authored Jan 5, 2024
2 parents a2cc0fb + da485b4 commit b059a98
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
21 changes: 0 additions & 21 deletions code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -313,27 +313,6 @@
else
return SPAN_DANGER("It looks heavily damaged.")

//
// Alt Interactions
//
/obj/get_alt_interactions(var/mob/user)
. = ..()
LAZYADD(., /decl/interaction_handler/rotate)

/decl/interaction_handler/rotate
name = "Rotate"
expected_target_type = /obj

/decl/interaction_handler/rotate/is_possible(atom/target, mob/user, obj/item/prop)
. = ..()
if(.)
var/obj/O = target
. = !!(O.obj_flags & OBJ_FLAG_ROTATABLE)

/decl/interaction_handler/rotate/invoked(atom/target, mob/user, obj/item/prop)
var/obj/O = target
O.rotate(user)

/obj/fluid_act(var/datum/reagents/fluids)
..()
if(!QDELETED(src) && fluids?.total_volume)
Expand Down
20 changes: 20 additions & 0 deletions code/game/objects/objs_interactions.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/obj/get_alt_interactions(mob/user)
. = ..()
LAZYADD(., /decl/interaction_handler/rotate)

/**
Interaction for rotating an object in the world.
*/
/decl/interaction_handler/rotate
name = "Rotate"
expected_target_type = /obj

/decl/interaction_handler/rotate/is_possible(atom/target, mob/user, obj/item/prop)
. = ..()
if(.)
var/obj/O = target
. = !!(O.obj_flags & OBJ_FLAG_ROTATABLE)

/decl/interaction_handler/rotate/invoked(atom/target, mob/user, obj/item/prop)
var/obj/O = target
O.rotate(user)
1 change: 1 addition & 0 deletions nebula.dme
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@
#include "code\game\objects\munition.dm"
#include "code\game\objects\objs.dm"
#include "code\game\objects\objs_damage.dm"
#include "code\game\objects\objs_interactions.dm"
#include "code\game\objects\topic.dm"
#include "code\game\objects\auras\aura.dm"
#include "code\game\objects\auras\blueforge_aura.dm"
Expand Down

0 comments on commit b059a98

Please sign in to comment.