From 80e78732987ac921247c85395d4d735d898cfa8e Mon Sep 17 00:00:00 2001 From: GuardianDll Date: Mon, 23 Dec 2024 21:56:48 +0100 Subject: [PATCH] Make monsters being able to evaluate enchantment conditions --- src/magic_enchantment.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/magic_enchantment.cpp b/src/magic_enchantment.cpp index 46f1bd6a39a14..09e8071bb1a05 100644 --- a/src/magic_enchantment.cpp +++ b/src/magic_enchantment.cpp @@ -317,11 +317,15 @@ bool enchantment::is_active( const Character &guy, const bool active ) const bool enchantment::is_active( const monster &mon ) const { //This is very limited at the moment. Basically, we can't use any conditions except "ALWAYS" - if( active_conditions.second == condition::ALWAYS && !mon.is_fake() ) { + if( active_conditions.second == condition::ALWAYS ) { return true; } - // Dialogue conditions for monsters seems like overkill. - // Definitely not an excuse for not knowing how to add them. Nope! Sure isn't! + + if( active_conditions.second == condition::DIALOG_CONDITION ) { + const_dialogue d( get_const_talker_for( mon ), nullptr ); + return dialog_condition( d ); + } + return false; }