mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Player/LocalPlayer/RemotePlayer inheritance cleanup (part 2 on X)
* Server/Client Environments now have an helper to cast Player object in the right type to use it * Server: use RemotePlayer everywhere and remove previous added casts * Client: use LocalPlayer where needed * Environment: remove unused functions (getPlayers(), getRandomConnectedPlayer(), getNearestConnectedPlayer())
This commit is contained in:
parent
9393e4a0a8
commit
656faf7373
12 changed files with 97 additions and 156 deletions
|
@ -25,7 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "inventory.h"
|
||||
#include "inventorymanager.h"
|
||||
|
||||
class Player;
|
||||
class RemotePlayer;
|
||||
|
||||
/*
|
||||
InvRef
|
||||
|
@ -112,7 +112,7 @@ public:
|
|||
// Creates an InvRef and leaves it on top of stack
|
||||
// Not callable from Lua; all references are created on the C side.
|
||||
static void create(lua_State *L, const InventoryLocation &loc);
|
||||
static void createPlayer(lua_State *L, Player *player);
|
||||
static void createPlayer(lua_State *L, RemotePlayer *player);
|
||||
static void createNodeMeta(lua_State *L, v3s16 p);
|
||||
static void Register(lua_State *L);
|
||||
};
|
||||
|
@ -123,11 +123,6 @@ private:
|
|||
|
||||
static int l_get_inventory(lua_State *L);
|
||||
|
||||
static void inventory_set_list_from_lua(Inventory *inv, const char *name,
|
||||
lua_State *L, int tableindex, int forcesize);
|
||||
static void inventory_get_list_to_lua(Inventory *inv, const char *name,
|
||||
lua_State *L);
|
||||
|
||||
public:
|
||||
static void Initialize(lua_State *L, int top);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue