Skip to content

Commit 8ea56f2

Browse files
committed
try fix windows bug 0006...
1 parent db08599 commit 8ea56f2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

source/world_builder/parameters.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,13 @@ namespace WorldBuilder
527527
// start with adding the additional points with the default value
528528
// to do this we need the default value
529529
double default_value = 0;
530-
enum InputTypes {DOUBLE_TYPE,ARRAY_TYPE,STRING_TYPE,MAX_INPUT_TYPES};
531-
InputTypes input_type = InputTypes::MAX_INPUT_TYPES;
530+
//enum InputTypes {DOUBLE_TYPE,ARRAY_TYPE,STRING_TYPE,MAX_INPUT_TYPES};
531+
//InputTypes input_type = InputTypes::MAX_INPUT_TYPES;
532+
bool is_array = false;
532533
if (Pointer((strict_base + "/" + name).c_str()).Get(parameters) != nullptr && Pointer((strict_base + "/" + name).c_str()).Get(parameters)->IsArray())
533534
{
534-
input_type = InputTypes::ARRAY_TYPE;
535+
is_array = true;
536+
//input_type = InputTypes::ARRAY_TYPE;
535537
const std::string value_def_path = get_full_json_schema_path() + "/" + name + "/oneOf/1/items/items/anyOf/0/default value";
536538
Value *value_def = Pointer(value_def_path.c_str()).Get(declarations);
537539
WBAssertThrow(value_def != nullptr,
@@ -544,13 +546,13 @@ namespace WorldBuilder
544546
}
545547
else if (Pointer((strict_base + "/" + name).c_str()).Get(parameters) != nullptr && Pointer((strict_base + "/" + name).c_str()).Get(parameters)->IsString())
546548
{
547-
input_type = InputTypes::STRING_TYPE;
549+
//input_type = InputTypes::STRING_TYPE;
548550
// I don't know if a default value makes sense here
549551

550552
}
551553
else
552554
{
553-
input_type = InputTypes::DOUBLE_TYPE;
555+
//input_type = InputTypes::DOUBLE_TYPE;
554556
Value *value_def = Pointer((get_full_json_schema_path() + "/" + name + "/oneOf/0/default value").c_str()).Get(declarations);
555557
WBAssertThrow(value_def != nullptr,
556558
"internal error: could not retrieve the default value at: "
@@ -567,7 +569,7 @@ namespace WorldBuilder
567569
if (Pointer((strict_base + "/" + name).c_str()).Get(parameters) != nullptr)
568570
{
569571
// there is a user defined value, so either case 2, 3 4, or 5.
570-
if (input_type == InputTypes::ARRAY_TYPE)
572+
if (is_array)//input_type == InputTypes::ARRAY_TYPE)
571573
{
572574
Value *array = Pointer((strict_base + "/" + name).c_str()).Get(parameters);
573575

0 commit comments

Comments
 (0)