MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / set

Method set

compat/fake_script.cpp:214–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214bool FakeScriptInstance::set(const StringName &p_name, const Variant &p_value) {
215 if (!owner) {
216 return false;
217 }
218 if (is_fake_embedded && script.is_valid() && script->is_instance_recording_properties()) {
219 MissingResource *mres = Object::cast_to<MissingResource>(owner);
220 if (mres && mres->is_recording_properties()) {
221 // let mres handle it
222 return false;
223 }
224 if (!properties.has(p_name)) {
225 // check if it's a property of the owning object
226 List<PropertyInfo> owner_properties;
227 owner->get_property_list(&owner_properties);
228 for (const PropertyInfo &pi : owner_properties) {
229 if (pi.name == p_name) {
230 return false;
231 }
232 }
233 }
234 properties[p_name] = p_value;
235 return true;
236 } // else
237 if (!has_cached_prop_name(p_name)) {
238 return false;
239 }
240 properties[p_name] = p_value;
241 return true;
242}
243
244bool FakeScriptInstance::get(const StringName &p_name, Variant &r_ret) const {
245 if (!properties.has(p_name)) {

Callers 15

loadMethod · 0.80
scan_variantFunction · 0.80
loadMethod · 0.80
parse_valueMethod · 0.80
decode_variant_3Method · 0.80
decode_variant_2Method · 0.80
_get_optionsMethod · 0.80
create_fromMethod · 0.80
convertMethod · 0.80

Calls 3

get_property_listMethod · 0.80
is_validMethod · 0.45

Tested by

no test coverage detected