From 8355428e4ef50943beef0b266db4082c8bc17527 Mon Sep 17 00:00:00 2001 From: Leshana Date: Sun, 5 Mar 2017 21:27:42 -0500 Subject: [PATCH] Adds Supply Shuttle Hook * Adds a global hook for when the supply shuttle reaches centcom. The existing sell_crate hook is too limited, as it only detects what is in crates, and is fired many times, making it hard to produce a summary for events that might want stuff shipped on the shuttle. --- code/controllers/hooks-defs.dm | 9 +++++++++ code/game/supplyshuttle.dm | 2 ++ 2 files changed, 11 insertions(+) diff --git a/code/controllers/hooks-defs.dm b/code/controllers/hooks-defs.dm index e330024475..82f7920752 100644 --- a/code/controllers/hooks-defs.dm +++ b/code/controllers/hooks-defs.dm @@ -85,3 +85,12 @@ * Parameters: var/obj/structure/closet/crate/sold, var/area/shuttle */ /hook/sell_crate + +/** + * Supply Shuttle sold hook. + * Called in supplyshuttle.dm when the shuttle contents are sold. + * This hook is called _before_ the crates are processed for normal + * phoron/metal sale (and before the sell_crate hooks) + * Parameters: var/area/area_shuttle + */ +/hook/sell_shuttle diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 6bf5010901..8ba95765b4 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -184,6 +184,8 @@ var/list/mechtoys = list( var/area/area_shuttle = shuttle.get_location_area() if(!area_shuttle) return + callHook("sell_shuttle", list(area_shuttle)); + var/phoron_count = 0 var/plat_count = 0