Formula engine: debug_print() now shows in chat if debug mode on
This commit is contained in:
parent
a02b1c13a1
commit
f8476368d3
1 changed files with 7 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "formula_debugger.hpp"
|
||||
#include "formula_function.hpp"
|
||||
#include "game_display.hpp"
|
||||
#include "game_config.hpp"
|
||||
#include "log.hpp"
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
@ -288,12 +289,18 @@ private:
|
|||
{
|
||||
str1 = var1.to_debug_string(NULL, true);
|
||||
LOG_SF << str1 << std::endl;
|
||||
if(game_config::debug) {
|
||||
game_display::get_singleton()->get_chat_manager().add_chat_message(time(NULL), "WFL", 0, str1, events::chat_handler::MESSAGE_PUBLIC, false);
|
||||
}
|
||||
return var1;
|
||||
} else {
|
||||
str1 = var1.string_cast();
|
||||
const variant var2 = args()[1]->evaluate(variables,fdb);
|
||||
str2 = var2.to_debug_string(NULL, true);
|
||||
LOG_SF << str1 << str2 << std::endl;
|
||||
if(game_config::debug) {
|
||||
game_display::get_singleton()->get_chat_manager().add_chat_message(time(NULL), str1, 0, str2, events::chat_handler::MESSAGE_PUBLIC, false);
|
||||
}
|
||||
return var2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue