1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Allow place_param2 = 0 node placement predictions (#13787)

The placement prediction value 0 was accidentally ignored
and made the clients fall back to automatic rotation based
on the node paramtype2 value.

This now changes the internal representation to properly
indicate the disabled state (e.g. 'nil' in Lua).
This commit is contained in:
SmallJoker 2023-09-13 13:57:57 +02:00 committed by GitHub
parent 833c324498
commit 4ef93fe25f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 9 deletions

View file

@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irrlichttypes_extrabloated.h"
#include <string>
#include <iostream>
#include <optional>
#include <set>
#include "itemgroup.h"
#include "sound.h"
@ -87,7 +88,7 @@ struct ItemDefinition
// Server will update the precise end result a moment later.
// "" = no prediction
std::string node_placement_prediction;
u8 place_param2;
std::optional<u8> place_param2;
/*
Some helpful methods