diff options
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/being.cpp b/src/being.cpp index 9dbff7f4..5911b03c 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -108,8 +108,8 @@ Being::Being(int id, Type type, int subtype, Map *map): setShowName(true); updateColors(); - listen(CHANNEL_CONFIG); - listen(CHANNEL_CHAT); + listen(Event::ConfigChannel); + listen(Event::ChatChannel); } Being::~Being() @@ -1170,11 +1170,12 @@ void Being::talkTo() Net::getNpcHandler()->talk(mId); } -void Being::event(Channels channel, const Mana::Event &event) +void Being::event(Event::Channel channel, const Event &event) { - if (channel == CHANNEL_CHAT && - (event.getName() == EVENT_BEING || event.getName() == EVENT_PLAYER) - && event.getInt("permissions") & PlayerRelation::SPEECH_FLOAT) + if (channel == Event::ChatChannel && + (event.getType() == Event::Being + || event.getType() == Event::Player) && + event.getInt("permissions") & PlayerRelation::SPEECH_FLOAT) { try { @@ -1183,11 +1184,11 @@ void Being::event(Channels channel, const Mana::Event &event) setSpeech(event.getString("text")); } } - catch (Mana::BadEvent badEvent) + catch (BadEvent badEvent) {} } - else if (channel == CHANNEL_CONFIG && - event.getName() == EVENT_CONFIGOPTIONCHANGED) + else if (channel == Event::ConfigChannel && + event.getType() == Event::ConfigOptionChanged) { if (getType() == PLAYER && event.getString("option") == "visiblenames") { |