Kovitikus

alternative stocked items

Dec 1st, 2020 (edited)
597
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Old Version
  2.         for k, v in stocked_items.items():
  3.             item_dic = gen_mec.return_proto_dic(k)
  4.  
  5.             name = item_dic.get('key')
  6.             price = item_dic.get('price', 0)
  7.             quantity = v
  8.  
  9.  
  10. # New Version
  11.         for k, v in stocked_items.items():
  12.             item_dic = utils.variable_from_module('world.items.item_prototypes', variable=k)
  13.  
  14.             name = item_dic.get('key')
  15.             price = item_dic.get('price', 0)
  16.             quantity = v
RAW Paste Data