Fixes random gear sometimes not spawning (#7388)

This commit is contained in:
Matt Atlas
2019-11-17 18:43:44 +02:00
committed by Erki
parent ca7d8aac1a
commit 663df76364
2 changed files with 59 additions and 44 deletions
+18 -3
View File
@@ -754,7 +754,12 @@
if(G.slot && !(G.slot in custom_equip_slots))
// This is a miserable way to fix the loadout overwrite bug, but the alternative requires
// adding an arg to a bunch of different procs. Will look into it after this merge. ~ Z
var/metadata = prefs.gear[G.display_name]
var/metadata
var/list/gear_test = prefs.gear[G.display_name]
if(gear_test?.len)
metadata = gear_test
else
metadata = list()
var/obj/item/CI = G.spawn_item(null,metadata)
if (G.slot == slot_wear_mask || G.slot == slot_wear_suit || G.slot == slot_head)
if (leftovers)
@@ -787,7 +792,12 @@
if (G.slot in used_slots)
. += thing
else
var/metadata = prefs.gear[G.display_name]
var/metadata
var/list/gear_test = prefs.gear[G.display_name]
if(gear_test?.len)
metadata = gear_test
else
metadata = list()
var/obj/item/CI = G.spawn_item(H, metadata)
if (H.equip_to_slot_or_del(CI, G.slot))
to_chat(H, "<span class='notice'>Equipping you with [thing]!</span>")
@@ -813,7 +823,12 @@
for (var/thing in items)
to_chat(H, "<span class='notice'>Placing \the [thing] in your [B.name]!</span>")
var/datum/gear/G = gear_datums[thing]
var/metadata = prefs.gear[G.display_name]
var/metadata
var/list/gear_test = prefs.gear[G.display_name]
if(gear_test?.len)
metadata = gear_test
else
metadata = list()
G.spawn_item(B, metadata)
Debug("EIS/([H]): placed [thing] in [B].")
@@ -1,41 +1,41 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: CodePanter
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- backend: "Added bash versions of all the map preparing and merging scripts in 'tools/mapmerge2/'."
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: MattAtlas
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "You should no longer randomly spawn without one of your loadout items."