mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
update block.get_field, block.set_field and fields-related docs
This commit is contained in:
parent
e0a4876f3f
commit
87cf6c41bc
6 changed files with 26 additions and 8 deletions
|
|
@ -372,6 +372,12 @@ void StructLayout::deserialize(const dv::value& src) {
|
|||
|
||||
int elements = 1;
|
||||
fieldmap.at("length").get(elements);
|
||||
if (elements <= 0) {
|
||||
throw std::runtime_error(
|
||||
"invalid field " + util::quote(name) + " length: " +
|
||||
std::to_string(elements)
|
||||
);
|
||||
}
|
||||
|
||||
auto convertStrategy = FieldConvertStrategy::RESET;
|
||||
if (fieldmap.has("convert-strategy")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue