mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Change the preprocessor macro that differs server/client builds
This commit is contained in:
parent
e2ea359925
commit
37095f3e49
45 changed files with 137 additions and 88 deletions
|
@ -28,7 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "porting.h"
|
||||
#include "util/string.h"
|
||||
#include "server.h"
|
||||
#ifndef SERVER
|
||||
#if CHECK_CLIENT_BUILD()
|
||||
#include "client/client.h"
|
||||
#endif
|
||||
|
||||
|
@ -185,7 +185,7 @@ int ScriptApiBase::luaPanic(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifndef SERVER
|
||||
#if CHECK_CLIENT_BUILD()
|
||||
void ScriptApiBase::clientOpenLibs(lua_State *L)
|
||||
{
|
||||
static const std::vector<std::pair<std::string, lua_CFunction>> m_libs = {
|
||||
|
@ -305,7 +305,7 @@ void ScriptApiBase::loadScript(const std::string &script_path)
|
|||
lua_pop(L, 1); // Pop error handler
|
||||
}
|
||||
|
||||
#ifndef SERVER
|
||||
#if CHECK_CLIENT_BUILD()
|
||||
void ScriptApiBase::loadModFromMemory(const std::string &mod_name)
|
||||
{
|
||||
ModNameStorer mod_name_storer(getStack(), mod_name);
|
||||
|
@ -351,7 +351,7 @@ void ScriptApiBase::loadModFromMemory(const std::string &mod_name)
|
|||
void ScriptApiBase::runCallbacksRaw(int nargs,
|
||||
RunCallbacksMode mode, const char *fxn)
|
||||
{
|
||||
#ifndef SERVER
|
||||
#if CHECK_CLIENT_BUILD()
|
||||
// Hard fail for bad guarded callbacks
|
||||
// Only run callbacks when the scripting enviroment is loaded
|
||||
FATAL_ERROR_IF(m_type == ScriptingType::Client &&
|
||||
|
@ -565,7 +565,7 @@ Server* ScriptApiBase::getServer()
|
|||
return dynamic_cast<Server *>(m_gamedef);
|
||||
}
|
||||
|
||||
#ifndef SERVER
|
||||
#if CHECK_CLIENT_BUILD()
|
||||
Client* ScriptApiBase::getClient()
|
||||
{
|
||||
return dynamic_cast<Client *>(m_gamedef);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue