mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 19:44:46 +01:00
Fix Runtime in loadout.dm,277: bad index
Runtime happens when someone has a saved preferences loadout containing an item that currently is expected to have gear_tweaks, but at the time that the savefile was last saved, did *not* have gear tweaks. Thus the saved prefs have null metadata. Also it makes no sense to check the length of a list *inside* a for loop iterating over that list.. TODO - Figure out if its okay to spawn it without the metadata.
This commit is contained in:
@@ -272,12 +272,12 @@ var/list/gear_datums = list()
|
||||
|
||||
/datum/gear/proc/spawn_item(var/location, var/metadata)
|
||||
var/datum/gear_data/gd = new(path, location)
|
||||
for(var/datum/gear_tweak/gt in gear_tweaks)
|
||||
if(gear_tweaks.len)
|
||||
if(length(gear_tweaks) && metadata)
|
||||
for(var/datum/gear_tweak/gt in gear_tweaks)
|
||||
gt.tweak_gear_data(metadata["[gt]"], gd)
|
||||
var/item = new gd.path(gd.location)
|
||||
for(var/datum/gear_tweak/gt in gear_tweaks)
|
||||
if(gear_tweaks.len)
|
||||
if(length(gear_tweaks) && metadata)
|
||||
for(var/datum/gear_tweak/gt in gear_tweaks)
|
||||
gt.tweak_item(item, metadata["[gt]"])
|
||||
var/mob/M = location
|
||||
if(istype(M) && exploitable) //Update exploitable info records for the mob without creating a duplicate object at their feet.
|
||||
|
||||
Reference in New Issue
Block a user