mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Formspec: Show a player inventory using core.show_formspec (#15963)
'core.show_formspec' now shows and updates the inventory formspec as if it was opened using the hotkey on client-side.
This commit is contained in:
parent
d41de3da79
commit
fdc149f316
10 changed files with 59 additions and 23 deletions
|
@ -1574,7 +1574,9 @@ int ObjectRef::l_set_inventory_formspec(lua_State *L)
|
|||
|
||||
auto formspec = readParam<std::string_view>(L, 2);
|
||||
|
||||
if (formspec != player->inventory_formspec) {
|
||||
if (player->inventory_formspec_overridden
|
||||
|| formspec != player->inventory_formspec) {
|
||||
player->inventory_formspec_overridden = false;
|
||||
player->inventory_formspec = formspec;
|
||||
getServer(L)->reportInventoryFormspecModified(player->getName());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue