|
9 | 9 | #include <queue>
|
10 | 10 | #include <stdexcept>
|
11 | 11 |
|
12 |
| -#include "assign.h" |
13 | 12 | #include "cata_utility.h"
|
14 | 13 | #include "debug.h"
|
15 | 14 | #include "dependency_tree.h"
|
16 | 15 | #include "filesystem.h"
|
17 | 16 | #include "flexbuffer_json.h"
|
| 17 | +#include "generic_factory.h" |
18 | 18 | #include "input_context.h"
|
19 | 19 | #include "json.h"
|
20 | 20 | #include "localized_comparator.h"
|
@@ -280,21 +280,22 @@ void mod_manager::load_modfile( const JsonObject &jo, const cata_path &path )
|
280 | 280 | modfile.category = p_cat;
|
281 | 281 |
|
282 | 282 | std::string mod_json_path;
|
283 |
| - if( assign( jo, "path", mod_json_path ) ) { |
| 283 | + if( jo.has_member( "path" ) ) { |
| 284 | + optional( jo, false, "path", mod_json_path ); |
284 | 285 | modfile.path = path / mod_json_path;
|
285 | 286 | } else {
|
286 | 287 | modfile.path = path;
|
287 | 288 | }
|
288 | 289 |
|
289 |
| - assign( jo, "authors", modfile.authors ); |
290 |
| - assign( jo, "maintainers", modfile.maintainers ); |
291 |
| - assign( jo, "description", modfile.description ); |
292 |
| - assign( jo, "version", modfile.version ); |
293 |
| - assign( jo, "dependencies", modfile.dependencies ); |
294 |
| - assign( jo, "conflicts", modfile.conflicts ); |
295 |
| - assign( jo, "core", modfile.core ); |
296 |
| - assign( jo, "obsolete", modfile.obsolete ); |
297 |
| - assign( jo, "loading_images", modfile.loading_images ); |
| 290 | + optional( jo, false, "authors", modfile.authors ); |
| 291 | + optional( jo, false, "maintainers", modfile.maintainers ); |
| 292 | + optional( jo, false, "description", modfile.description ); |
| 293 | + optional( jo, false, "version", modfile.version ); |
| 294 | + optional( jo, false, "dependencies", modfile.dependencies ); |
| 295 | + optional( jo, false, "conflicts", modfile.conflicts ); |
| 296 | + optional( jo, false, "core", modfile.core, false ); |
| 297 | + optional( jo, false, "obsolete", modfile.obsolete, false ); |
| 298 | + optional( jo, false, "loading_images", modfile.loading_images ); |
298 | 299 |
|
299 | 300 | if( std::find( modfile.dependencies.begin(), modfile.dependencies.end(),
|
300 | 301 | modfile.ident ) != modfile.dependencies.end() ) {
|
|
0 commit comments