summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-01-28 16:41:23 -0500
committerrealtradam <[email protected]>2022-01-28 16:41:23 -0500
commitbf6769c6b1658c5f6a7b02fc8fc0400fc4f61dec (patch)
tree774e8174ead6b7d726a3b5342fe457faebaa3449 /lib
parenteb84d916fb2b14db386d9f1f69fe0f310a5f1d8a (diff)
downloadFelECS-bf6769c6b1658c5f6a7b02fc8fc0400fc4f61dec.tar.gz
FelECS-bf6769c6b1658c5f6a7b02fc8fc0400fc4f61dec.zip
fix order of attr triggers
Diffstat (limited to 'lib')
-rw-r--r--lib/felecs/component_manager.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/felecs/component_manager.rb b/lib/felecs/component_manager.rb
index 36916cb..02e4d05 100644
--- a/lib/felecs/component_manager.rb
+++ b/lib/felecs/component_manager.rb
@@ -36,8 +36,10 @@ module FelECS
attrs_with_defaults[attr] = _default.dup
FelECS::Components.const_get(component_name).attr_reader attr
FelECS::Components.const_get(component_name).define_method("#{attr}=") do |value|
- attr_changed_trigger_systems(attr) unless value.equal? send(attr)
- instance_variable_set("@#{attr}", value)
+ unless value.equal? send(attr)
+ instance_variable_set("@#{attr}", value)
+ attr_changed_trigger_systems(attr)
+ end
end
end
FelECS::Components.const_get(component_name).define_method(:set_defaults) do