diff --git a/skeleton/entity_equipset.cpp b/skeleton/entity_equipset.cpp index a3bd705..5dc024e 100644 --- a/skeleton/entity_equipset.cpp +++ b/skeleton/entity_equipset.cpp @@ -40,7 +40,7 @@ void EntityEquipSet::_validate_property(PropertyInfo &property) const { String prop = property.name; if (prop.begins_with("Entry_")) { int frame = prop.get_slicec('/', 0).get_slicec('_', 1).to_int(); - if (frame > _entry_count) { + if (frame >= _entry_count) { property.usage = 0; } } @@ -49,7 +49,8 @@ void EntityEquipSet::_validate_property(PropertyInfo &property) const { void EntityEquipSet::_bind_methods() { ClassDB::bind_method(D_METHOD("get_entry_count"), &EntityEquipSet::get_entry_count); ClassDB::bind_method(D_METHOD("set_entry_count", "value"), &EntityEquipSet::set_entry_count); - + ADD_PROPERTY(PropertyInfo(Variant::INT, "entry_count", PROPERTY_HINT_RANGE, "0," + itos(MAX_ENTRIES), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "set_entry_count", "get_entry_count"); + ClassDB::bind_method(D_METHOD("get_entry", "index"), &EntityEquipSet::get_entry); ClassDB::bind_method(D_METHOD("set_entry", "index", "entry"), &EntityEquipSet::set_entry);