From aeb19d3f7e9aca2d60a472dee9eccdbb6bff5e84 Mon Sep 17 00:00:00 2001 From: Penelope Haze Date: Tue, 12 Dec 2023 08:39:14 -0500 Subject: [PATCH] [MODULAR] Readd fan_out_items to armory spawner (#21646) Readd fan_out_items to armory spawner [SQUASH] Fix fan_out_items --- .../modules/sec_haul/code/guns/armory_spawns.dm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modular_skyrat/modules/sec_haul/code/guns/armory_spawns.dm b/modular_skyrat/modules/sec_haul/code/guns/armory_spawns.dm index 517aeded62d..d6406a59589 100644 --- a/modular_skyrat/modules/sec_haul/code/guns/armory_spawns.dm +++ b/modular_skyrat/modules/sec_haul/code/guns/armory_spawns.dm @@ -6,7 +6,7 @@ /// A list of possible guns to spawn. var/list/guns /// Do we fan out the items spawned for a natural effect? - var/fan_out_items = TRUE + var/fan_out_items = FALSE /// How many mags per gun do we spawn, if it takes magazines. var/mags_to_spawn = 3 /// Do we want to angle it so that it is horizontal? @@ -17,15 +17,18 @@ . = ..() if(guns) - var/current_offset = -10 + var/gun_count = 0 var/offset_percent = 20 / guns.len for(var/gun in guns) // 11/20/21: Gun spawners now spawn 1 of each gun in it's list no matter what, so as to reduce the RNG of the armory stock. var/obj/item/gun/spawned_gun = new gun(loc) if(vertical_guns) spawned_gun.place_on_rack() - spawned_gun.pixel_x = current_offset - current_offset += offset_percent + spawned_gun.pixel_x = -10 + (offset_percent * gun_count) + else if (fan_out_items) + spawned_gun.pixel_x = spawned_gun.pixel_y = ((!(gun_count%2)*gun_count/2)*-1)+((gun_count%2)*(gun_count+1)/2*1) + + gun_count++ if(istype(spawned_gun, /obj/item/gun/ballistic)) var/obj/item/gun/ballistic/spawned_ballistic_gun = spawned_gun