You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-21 14:57:09 +00:00
ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits.
This commit is contained in:
@@ -156,8 +156,8 @@ bool EditorHistory::is_history_obj_inspector_only(int p_obj) const {
|
||||
}
|
||||
|
||||
ObjectID EditorHistory::get_history_obj(int p_obj) const {
|
||||
ERR_FAIL_INDEX_V(p_obj, history.size(), 0);
|
||||
ERR_FAIL_INDEX_V(history[p_obj].level, history[p_obj].path.size(), 0);
|
||||
ERR_FAIL_INDEX_V(p_obj, history.size(), ObjectID());
|
||||
ERR_FAIL_INDEX_V(history[p_obj].level, history[p_obj].path.size(), ObjectID());
|
||||
return history[p_obj].path[history[p_obj].level].object;
|
||||
}
|
||||
|
||||
@@ -204,12 +204,12 @@ bool EditorHistory::is_current_inspector_only() const {
|
||||
ObjectID EditorHistory::get_current() {
|
||||
|
||||
if (current < 0 || current >= history.size())
|
||||
return 0;
|
||||
return ObjectID();
|
||||
|
||||
History &h = history.write[current];
|
||||
Object *obj = ObjectDB::get_instance(h.path[h.level].object);
|
||||
if (!obj)
|
||||
return 0;
|
||||
return ObjectID();
|
||||
|
||||
return obj->get_instance_id();
|
||||
}
|
||||
@@ -226,15 +226,15 @@ int EditorHistory::get_path_size() const {
|
||||
ObjectID EditorHistory::get_path_object(int p_index) const {
|
||||
|
||||
if (current < 0 || current >= history.size())
|
||||
return 0;
|
||||
return ObjectID();
|
||||
|
||||
const History &h = history[current];
|
||||
|
||||
ERR_FAIL_INDEX_V(p_index, h.path.size(), 0);
|
||||
ERR_FAIL_INDEX_V(p_index, h.path.size(), ObjectID());
|
||||
|
||||
Object *obj = ObjectDB::get_instance(h.path[p_index].object);
|
||||
if (!obj)
|
||||
return 0;
|
||||
return ObjectID();
|
||||
|
||||
return obj->get_instance_id();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user