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:
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 dataExpected 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.