@@ -1389,6 +1389,7 @@ template<typename Derived>
1389
1389
class generic_typed_reader
1390
1390
{
1391
1391
static constexpr bool read_objects = false ;
1392
+ static constexpr bool check_extend_delete_copy_from = true ;
1392
1393
public:
1393
1394
template <typename C, typename Fn>
1394
1395
// I tried using a member function pointer and couldn't work it out
@@ -1619,8 +1620,11 @@ class generic_typed_reader
1619
1620
const Derived &derived = static_cast <const Derived &>( *this );
1620
1621
// or no handler for the container
1621
1622
if ( !was_loaded ) {
1622
- warn_disabled_feature ( jo, " extend" , member_name, " no copy-from" );
1623
- warn_disabled_feature ( jo, " delete" , member_name, " no copy-from" );
1623
+ // this is gross, but some JSON wants to delete from things loaded by a different member on the same entity
1624
+ if ( Derived::check_extend_delete_copy_from ) {
1625
+ warn_disabled_feature ( jo, " extend" , member_name, " no copy-from" );
1626
+ warn_disabled_feature ( jo, " delete" , member_name, " no copy-from" );
1627
+ }
1624
1628
warn_disabled_feature ( jo, " relative" , member_name, " no copy-from" );
1625
1629
warn_disabled_feature ( jo, " proportional" , member_name, " no copy-from" );
1626
1630
}
@@ -2083,6 +2087,20 @@ class time_bound_reader : public bound_reader<T>
2083
2087
};
2084
2088
};
2085
2089
2090
+ struct weakpoints ;
2091
+
2092
+ struct weakpoints_reader : generic_typed_reader<weakpoints_reader> {
2093
+ static constexpr bool check_extend_delete_copy_from = false ;
2094
+
2095
+ std::set<std::string> &deleted;
2096
+
2097
+ explicit weakpoints_reader ( std::set<std::string> &del ) : deleted( del ) {}
2098
+
2099
+ weakpoints get_next ( const JsonValue &jv ) const ;
2100
+ bool do_extend ( const JsonObject &jo, std::string_view name, weakpoints &member ) const ;
2101
+ bool do_delete ( const JsonObject &jo, std::string_view name, weakpoints &member ) const ;
2102
+ };
2103
+
2086
2104
/* *
2087
2105
* Only for external use in legacy code where migrating to `class translation`
2088
2106
* is impractical. For new code load with `class translation` instead.
0 commit comments