diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 826d38247e..c198afcde1 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -7552,7 +7552,7 @@ Example: *debugmes ""; -This command will send the message to the server console (map-server window). It +This command will send a debug message to the server console (map-server window). It will not be displayed anywhere else. // Displays "NAME has clicked me!" in the map-server window. @@ -7560,6 +7560,16 @@ will not be displayed anywhere else. --------------------------------------- +*errormes ""; + +This command will send an error message to the server console (map-server window). It +will not be displayed anywhere else. + + // Displays "NAME has clicked me!" in the map-server window. + errormes strcharinfo(0) + " has clicked me!"; + +--------------------------------------- + *logmes ""; This command will write the message given to the map server NPC log file, as diff --git a/npc/test/ci/5573.txt b/npc/test/ci/5573.txt new file mode 100644 index 0000000000..8a8d54ba61 --- /dev/null +++ b/npc/test/ci/5573.txt @@ -0,0 +1,9 @@ +- script Issue5573 -1,{ +OnInit: + .i = 0; + .@i = min( .i, 200 ); + + if( .@i == 200 ){ + errormes "Issue 5573 is happening again."; + } +} diff --git a/src/map/script.cpp b/src/map/script.cpp index 7d0f341a41..edbd5434ae 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -11901,6 +11901,13 @@ BUILDIN_FUNC(debugmes) return SCRIPT_CMD_SUCCESS; } +BUILDIN_FUNC( errormes ){ + ShowError( "%s\n", script_getstr( st, 2 ) ); + script_reportsrc( st ); + + return SCRIPT_CMD_SUCCESS; +} + /*========================================== *------------------------------------------*/ BUILDIN_FUNC(catchpet) @@ -23184,6 +23191,9 @@ BUILDIN_FUNC(minmax){ value = func( value, get_val2_num( st, reference_uid( id, start ), reference_getref( data ) ) ); } } + else { + value = func( value, 0 ); + } }else{ ShowError( "buildin_%s: not a supported data type!\n", functionname ); script_reportdata( data ); @@ -25129,6 +25139,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(getstatus, "i??"), BUILDIN_DEF(getscrate,"ii?"), BUILDIN_DEF(debugmes,"s"), + BUILDIN_DEF(errormes,"s"), BUILDIN_DEF2(catchpet,"pet","i"), BUILDIN_DEF2(birthpet,"bpet",""), BUILDIN_DEF(catchpet,"i"),