Skip to content

Commit

Permalink
Fixed an error
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 committed May 20, 2024
1 parent 89f1e11 commit 7fc2fb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions _testing/console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ JSONHTTP({
url = "https://" .. url .. "/api/client/servers/" .. id .. "/resources",
headers = header,
success = function(content)
if content.attributes.current_state == "running" then
if content.attributes and content.attributes.current_state == "running" then
HTTP({
method = "POST",
url = "https://" .. url .. "/api/client/servers/" .. id .. "/command",
Expand All @@ -96,7 +96,7 @@ JSONHTTP({
url = "https://" .. url .. "/api/client/servers/" .. id .. "/resources",
headers = header,
success = function(content)
if content.attributes.current_state == "offline" then
if content.attributes and content.attributes.current_state == "offline" then
stopped = true
end
end,
Expand Down Expand Up @@ -134,7 +134,7 @@ while not started do
url = "https://" .. url .. "/api/client/servers/" .. id .. "/resources",
headers = header,
success = function(content)
if content.attributes.current_state == "running" then
if content.attributes and content.attributes.current_state == "running" then
started = true
end
end,
Expand Down Expand Up @@ -189,7 +189,7 @@ while not stopped do
url = "https://" .. url .. "/api/client/servers/" .. id .. "/resources",
headers = header,
success = function(content)
if content.attributes.current_state == "offline" then
if content.attributes and content.attributes.current_state == "offline" then
stopped = true
end
end,
Expand Down
16 changes: 8 additions & 8 deletions source/lua_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,19 @@ struct GMOD_Info
const char* branch = "Unknown";

bool threadready = false;
GarrysMod::Lua::ILuaGameCallback* gamecallback;
GarrysMod::Lua::ILuaGameCallback* gamecallback = nullptr;

// engine library
ILuaValue* addons;
ILuaValue* games;
ILuaValue* gamemodes;
ILuaValue* usercontent;
ILuaValue* addons = nullptr;
ILuaValue* games = nullptr;
ILuaValue* gamemodes = nullptr;
ILuaValue* usercontent = nullptr;

const char* active_gamemode;
const char* active_gamemode = "";

// Locking
bool request_lock;
bool is_locked;
bool request_lock = false;
bool is_locked = false;
};

inline float Lerp(float delta, float from, float to)
Expand Down

0 comments on commit 7fc2fb0

Please sign in to comment.