Original Post — Direct link
When attempting GetBlock on certain block air variants, sometimes the safe call (with model, coords, and direction) will fail when it should not.

Here is an example map editor plugin to show the problem (run it on an empty map):

Code:
#RequireContext CMapEditorPlugin

declare CBlockModel Model = GetBlockModelFromName("RoadBumpTiltCurve2DownRight");
PlaceBlock(Model, <27,16,22>, ::CardinalDirections::East);
RemoveBlock(<27,15,22>); // we want the air variant, so either run this line, or enable Air Block Mode
AutoSave(); // this forces an update to the placed block which gives it the correct air variant

declare CBlock Result1 = GetBlock(Model, <27,16,22>, ::CardinalDirections::East); // this line fails
log(Result1); // null
declare CBlock Result2 = GetBlock(<27,16,22>); // this line succeeds
log(Result2); // block data
Expected behavior is for both GetBlock invocations in the script above to return the same results, but the actual behavior is that the first call returns null.
over 3 years ago - Ubi-Raziel - Direct link
Originally Posted by Phlarx
When attempting GetBlock on certain block air variants, sometimes the safe call (with model, coords, and direction) will fail when it should not.

Here is an example map editor plugin to show the problem (run it on an empty map):

Code:
#RequireContext CMapEditorPlugin

declare CBlockModel Model = GetBlockModelFromName("RoadBumpTiltCurve2DownRight");
PlaceBlock(Model, <27,16,22>, ::CardinalDirections::East);
RemoveBlock(<27,15,22>); // we want the air variant, so either run this line, or enable Air Block Mode
AutoSave(); // this forces an update to the placed block which gives it the correct air variant

declare CBlock Result1 = GetBlock(Model, <27,16,22>, ::CardinalDirections::East); // this line fails
log(Result1); // null
declare CBlock Result2 = GetBlock(<27,16,22>); // this line succeeds
log(Result2); // block data
Expected behavior is for both GetBlock invocations in the script above to return the same results, but the actual behavior is that the first call returns null.
Hello! Thank you for your report, I hope you are well.

My apologies, I'm finding this difficult to understand and visualise without a visual presentation.

Would it be possible to provide a video showing and explaining the issue? We can forward it to our devs and I'm sure they would be able to find a solution for us.

Thank you!