summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2025-01-21 09:25:46 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2025-01-21 09:29:23 +0100
commite224a015dbb69db35a9403f40ede7fc397d549fc (patch)
tree97bb25d8302ef3cc60077383abd3076753f34b71 /src/being.cpp
parentdb9b9f316d7bdcb9504092908bb18e82fc21de2f (diff)
downloadmana-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.cpp2
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);
}