diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-01-21 09:25:46 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-01-21 09:29:23 +0100 |
commit | e224a015dbb69db35a9403f40ede7fc397d549fc (patch) | |
tree | 97bb25d8302ef3cc60077383abd3076753f34b71 /src/being.cpp | |
parent | db9b9f316d7bdcb9504092908bb18e82fc21de2f (diff) | |
download | mana-e224a015dbb69db35a9403f40ede7fc397d549fc.tar.gz mana-e224a015dbb69db35a9403f40ede7fc397d549fc.tar.bz2 mana-e224a015dbb69db35a9403f40ede7fc397d549fc.tar.xz mana-e224a015dbb69db35a9403f40ede7fc397d549fc.zip |
Fixed ConfigOptionChanged events
With the statically typed config we no longer get an event for each
changed config value. Where relevant, this is now done through
`setConfigValue`.
The `Event` now uses a `std::any`, which for `ConfigOptionChanged`
events is set to the changed `Config` member. This allows for a
type-safe check on which config value was changed.
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/being.cpp b/src/being.cpp index 821f7054..56ed65f7 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -1232,7 +1232,7 @@ void Being::event(Event::Channel channel, const Event &event) else if (channel == Event::ConfigChannel && event.getType() == Event::ConfigOptionChanged) { - if (getType() == PLAYER && event.getString("option") == "visiblenames") + if (getType() == PLAYER && event.hasValue(&Config::visibleNames)) { setShowName(config.visibleNames); } |