Code: Select all
// Raise if lower.
if (corner_height < desired_corner_height) {
if(!AITile.RaiseTile(tile, slope_array[corner_index]))
// Error handler.
::main.ErrorHandler(this, "LandscapeSlope"); // See below....
else
landscape_success = true;
}
// Lower if higher.
else if (corner_height > desired_corner_height) {
if(!AITile.LowerTile(tile, slope_array[corner_index]))
// Error handler.
::main.ErrorHandler(this, "LandscapeSlope"); // See below....
else
landscape_success = true;
}
/*
* Generic error handler which displays the latest error in log and breaks.
* For errors to be detected GetLastError must be called literally as the next thing
* after a DO COMMAND, no variables assignments in squirrel, nothing! Eg:
* if(!DoCommand(param))
* // Error handler.
* ::main.ErrorHandler(class, function_name);
* AIError.GetLastError() is called in here.
* @param caller_object The class pointer for the function that called this error handler function, used for name reporting.
* @param function_name String of calling function name, for reporting.
*/
function RadAI::ErrorHandler(caller_object, function_name) {...}