Fixed equipset's bindings.

This commit is contained in:
Relintai 2019-07-23 19:10:43 +02:00
parent 3906bea408
commit 35efa1fd9b

View File

@ -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);