fixed bug when hook.Call calls a hook more than 1 time

This commit is contained in:
Mestima 2023-10-10 23:50:49 +03:00
parent bab2506cc7
commit 805257da76

View File

@ -21,7 +21,6 @@ void Hook::Call(String event, Array args = Array(), bool defer = false) {
} }
} }
for (int i = 0; i < table.size(); i++) {
Dictionary tmp = table.get(event, Dictionary()); Dictionary tmp = table.get(event, Dictionary());
if (!tmp.is_empty()) { if (!tmp.is_empty()) {
Array keys = tmp.keys(); Array keys = tmp.keys();
@ -37,7 +36,6 @@ void Hook::Call(String event, Array args = Array(), bool defer = false) {
} else { } else {
ERR_PRINT("Hook event '" + event + "' cannot be found or empty."); ERR_PRINT("Hook event '" + event + "' cannot be found or empty.");
} }
}
} }
void Hook::Remove(String event, String uid) { void Hook::Remove(String event, String uid) {