Stoeoeoe / godot_data_editor

A data editor plugin for the Godot game engine
MIT License
46 stars 12 forks source link

data.set_progress() always fails if initial value is 0. #7

Closed RizbanR closed 6 years ago

RizbanR commented 6 years ago
func set_progress(item_class, id, property, value):
    var item = item_manager.get_item(item_class, id)
    var has_value = item.get(property)
    if item and has_value:
        ...
        return true
    else:
        return false

This code in data.gd will always return false if the initial value you're trying to modify is 0. When run, has_value will be set to 0, which is then calculated as "false" in the if statement.

Stoeoeoe commented 6 years ago

Hi, sorry for the late reply. I changed the way the property check is done (property in item). I pushed the change. Could you check if it works with the newest version on the repo?