mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
small fix
This commit is contained in:
parent
beaeba43af
commit
5669b10036
2 changed files with 7 additions and 4 deletions
|
|
@ -1,16 +1,15 @@
|
||||||
#ifndef FRONTEND_GUI_GUI_HPP_
|
#ifndef FRONTEND_GUI_GUI_HPP_
|
||||||
#define FRONTEND_GUI_GUI_HPP_
|
#define FRONTEND_GUI_GUI_HPP_
|
||||||
|
|
||||||
|
#include "../../delegates.h"
|
||||||
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <functional>
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "../../delegates.h"
|
|
||||||
|
|
||||||
class Viewport;
|
class Viewport;
|
||||||
class GfxContext;
|
class GfxContext;
|
||||||
class Assets;
|
class Assets;
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,11 @@ static bool setattr(lua_State* L, Menu* menu, const std::string& attr) {
|
||||||
static bool setattr(lua_State* L, InventoryView* inventory, const std::string& attr) {
|
static bool setattr(lua_State* L, InventoryView* inventory, const std::string& attr) {
|
||||||
if (attr == "inventory") {
|
if (attr == "inventory") {
|
||||||
auto inv = scripting::level->inventories->get(lua_tointeger(L, 1));
|
auto inv = scripting::level->inventories->get(lua_tointeger(L, 1));
|
||||||
inventory->bind(inv, scripting::content);
|
if (inv == nullptr) {
|
||||||
|
inventory->unbind();
|
||||||
|
} else {
|
||||||
|
inventory->bind(inv, scripting::content);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue