Inventory saving and commands rewrite