File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -215,14 +215,18 @@ impl ToolkitTabViewer<'_> {
215215 tx. send ( UnpackerProgress { file_name : file_path. to_string_lossy ( ) . into ( ) , progress : 0.0 } ) . unwrap ( ) ;
216216
217217 let pickle = game_params_to_pickle ( game_params_data) . expect ( "failed to deserialize GameParams" ) ;
218- let params_dict = match pickle {
219- pickled:: Value :: Dict ( mut params_dict) => {
220- params_dict. remove ( & HashableValue :: String ( "" . to_string ( ) ) ) . expect ( "Could not find base game params with empty key" )
221- }
222- pickled:: Value :: List ( mut params_list) => params_list. remove ( 0 ) ,
223- _other => {
224- panic ! ( "Unexpected GameParams root element type" ) ;
218+ let params_dict = if base_params {
219+ match pickle {
220+ pickled:: Value :: Dict ( mut params_dict) => {
221+ params_dict. remove ( & HashableValue :: String ( "" . to_string ( ) ) ) . expect ( "Could not find base game params with empty key" )
222+ }
223+ pickled:: Value :: List ( mut params_list) => params_list. remove ( 0 ) ,
224+ _other => {
225+ panic ! ( "Unexpected GameParams root element type" ) ;
226+ }
225227 }
228+ } else {
229+ pickle
226230 } ;
227231
228232 let mut file = BufWriter :: new ( File :: create ( & file_path) . expect ( "failed to create GameParams.json file" ) ) ;
You can’t perform that action at this time.
0 commit comments