From 4820998c566ae405772bae240e294c95dea56c65 Mon Sep 17 00:00:00 2001 From: Cory Petkovsek <632766+tinmanjuggernaut@users.noreply.github.com> Date: Wed, 13 Nov 2019 13:20:05 +0800 Subject: [PATCH] Fix build errors due to Godot macro change --- streams/voxel_stream.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/streams/voxel_stream.cpp b/streams/voxel_stream.cpp index 278cce5e..a2ceebf2 100644 --- a/streams/voxel_stream.cpp +++ b/streams/voxel_stream.cpp @@ -18,13 +18,11 @@ void VoxelStream::emerge_block(Ref out_buffer, Vector3i origin_in_v const Variant *args[3] = { &arg1, &arg2, &arg3 }; Variant::CallError err; script->call("emerge_block", args, 3, err); - if (err.error != Variant::CallError::CALL_OK) { - ERR_EXPLAIN("voxel_stream.cpp:emerge_block gave an error: " + String::num(err.error) + - ", Argument: " + String::num(err.argument) + - ", Expected type: " + Variant::get_type_name(err.expected)); - ERR_FAIL(); - // This had to be explicitely logged due to the usual GD debugger not working with threads - } + ERR_FAIL_COND_MSG(err.error != Variant::CallError::CALL_OK, + "voxel_stream.cpp:emerge_block gave an error: " + String::num(err.error) + + ", Argument: " + String::num(err.argument) + + ", Expected type: " + Variant::get_type_name(err.expected)); + // This had to be explicitely logged due to the usual GD debugger not working with threads } } @@ -39,13 +37,11 @@ void VoxelStream::immerge_block(Ref buffer, Vector3i origin_in_voxe const Variant *args[3] = { &arg1, &arg2, &arg3 }; Variant::CallError err; script->call("immerge_block", args, 3, err); - if (err.error != Variant::CallError::CALL_OK) { - ERR_EXPLAIN("voxel_stream.cpp:immerge_block gave an error: " + String::num(err.error) + - " Argument: " + String::num(err.argument) + - " Expected type: " + Variant::get_type_name(err.expected)); - ERR_FAIL(); - // This had to be explicitely logged due to the usual GD debugger not working with threads - } + ERR_FAIL_COND_MSG(err.error != Variant::CallError::CALL_OK, + "voxel_stream.cpp:immerge_block gave an error: " + String::num(err.error) + + " Argument: " + String::num(err.argument) + + " Expected type: " + Variant::get_type_name(err.expected)); + // This had to be explicitely logged due to the usual GD debugger not working with threads } }