diff options
| author | Alexander Pickering <alex@cogarr.net> | 2018-08-05 18:34:24 -0400 |
|---|---|---|
| committer | Alexander Pickering <alex@cogarr.net> | 2018-08-05 18:34:24 -0400 |
| commit | 2f814449ff099747e50e13a78503d4ce17920203 (patch) | |
| tree | 53f230ad98acf1dfe4d9c9127b71afd5e3767699 /src | |
| parent | 1d677927e73e2d66591738777f6a1559527dbab2 (diff) | |
| download | brokengine-2f814449ff099747e50e13a78503d4ce17920203.tar.gz brokengine-2f814449ff099747e50e13a78503d4ce17920203.tar.bz2 brokengine-2f814449ff099747e50e13a78503d4ce17920203.zip | |
Added data folder to lua path for client and server
Both the client and the server now look in their respective folders
for ../data/?.lua when require() is called.
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/main.cpp | 2 | ||||
| -rw-r--r-- | src/server/main.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/client/main.cpp b/src/client/main.cpp index 5462e31..b10b8ef 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -112,6 +112,8 @@ int main(int argc, char *argv[]){ phys_genesis(); //Create a new lua state, this gets shared everywhere + //Set the path for lua + putenv("LUA_PATH=../data/?.lua"); lua_State *state = luaL_newstate(); L = state; printf("Created lua state at %p\n",L); diff --git a/src/server/main.cpp b/src/server/main.cpp index 89d6703..bd731c2 100644 --- a/src/server/main.cpp +++ b/src/server/main.cpp @@ -34,6 +34,8 @@ void gameloop(){ int main (){ printf("Brok[en]gine Server\n"); + + putenv("LUA_PATH=../data/?.lua"); L = luaL_newstate(); lua_newtable(L); |
