@@ -44,7 +44,7 @@ struct errordata {
44
44
int line;
45
45
const char * callerfilename;
46
46
int callerline;
47
- int errid ;
47
+ const char * errname ;
48
48
};
49
49
static autoarray<errordata> errors;
50
50
static int numerror;
@@ -86,7 +86,7 @@ void print(const char * str)
86
86
prints[numprint++]= duplicate_string (str);
87
87
}
88
88
89
- static void fillerror (errordata& myerr, int errid , const char * type, const char * str, bool show_block)
89
+ static void fillerror (errordata& myerr, const char * errname , const char * type, const char * str, bool show_block)
90
90
{
91
91
const char * current_filename = get_current_file_name ();
92
92
if (current_filename) myerr.filename = duplicate_string (current_filename);
@@ -104,8 +104,7 @@ static void fillerror(errordata& myerr, int errid, const char * type, const char
104
104
myerr.callerline =get_previous_file_line_no ();
105
105
const char * prev_file = get_previous_file_name ();
106
106
myerr.callerfilename =prev_file ? duplicate_string (prev_file) : nullptr ;
107
- // RPG Hacker: TODO: Rework this into error/warning name string once we bump the DLL API version again.
108
- myerr.errid = errid;
107
+ myerr.errname = duplicate_string (errname);
109
108
}
110
109
111
110
static bool ismath=false ;
@@ -118,7 +117,7 @@ void error_interface(int errid, int whichpass, const char * e_)
118
117
else if (pass == whichpass) {
119
118
// don't show current block if the error came from an error command
120
119
bool show_block = (errid != error_id_error_command);
121
- fillerror (errors[numerror++], errid, STR " error: (" + get_error_name ((asar_error_id)errid) + " ): " , e_, show_block);
120
+ fillerror (errors[numerror++], get_error_name ((asar_error_id) errid) , STR " error: (" + get_error_name ((asar_error_id)errid) + " ): " , e_, show_block);
122
121
}
123
122
else {}// ignore anything else
124
123
}
@@ -127,7 +126,7 @@ void warn(int errid, const char * str)
127
126
{
128
127
// don't show current block if the warning came from a warn command
129
128
bool show_block = (errid != warning_id_warn_command);
130
- fillerror (warnings[numwarn++], errid, STR " warning: (" + get_warning_name ((asar_warning_id)errid) + " ): " , str, show_block);
129
+ fillerror (warnings[numwarn++], get_warning_name ((asar_warning_id) errid) , STR " warning: (" + get_warning_name ((asar_warning_id)errid) + " ): " , str, show_block);
131
130
}
132
131
133
132
@@ -152,6 +151,7 @@ static void resetdllstuff()
152
151
free_and_null (errors[i].fullerrdata );
153
152
free_and_null (errors[i].callerfilename );
154
153
free_and_null (errors[i].block );
154
+ free_and_null (errors[i].errname );
155
155
}
156
156
errors.reset ();
157
157
numerror=0 ;
0 commit comments