Skip to content

Commit

Permalink
Fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wopss committed Sep 27, 2023
1 parent c75d32b commit 43b181a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/native_globals_redscript/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ void SummonVehiclePlease(RED4ext::IScriptable* aContext, RED4ext::CStackFrame* a
auto getQuickSlotsManagerFunc = playerPuppetCls->GetFunction("GetQuickSlotsManager");

RED4ext::Handle<RED4ext::IScriptable> quickSlotManager;

// Execute the function on our Player instance
RED4ext::ExecuteFunction(handle, getQuickSlotsManagerFunc, &quickSlotManager, {});
RED4ext::ExecuteFunction(handle, getQuickSlotsManagerFunc, &quickSlotManager);

auto quickSlotsManagerCls = rtti->GetClass("QuickSlotsManager ");
auto summonVehicleFunc = quickSlotsManagerCls->GetFunction("SummonVehicle");

RED4ext::ExecuteFunction(quickSlotManager, summonVehicleFunc, nullptr, {});
RED4ext::ExecuteFunction(quickSlotManager, summonVehicleFunc, nullptr);
}
}

Expand Down
6 changes: 6 additions & 0 deletions include/RED4ext/Scripting/Utils-inl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
#include <RED4ext/Scripting/Functions.hpp>
#include <RED4ext/Scripting/IScriptable.hpp>

RED4EXT_INLINE bool RED4ext::ExecuteFunction(ScriptInstance aInstance, CBaseFunction* aFunc, void* aOut)
{
StackArgs_t args;
return ExecuteFunction(aInstance, aFunc, aOut, args);
}

RED4EXT_INLINE bool RED4ext::ExecuteFunction(ScriptInstance aInstance, CBaseFunction* aFunc, void* aOut,
StackArgs_t& aArgs)
{
Expand Down
1 change: 1 addition & 0 deletions include/RED4ext/Scripting/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace RED4ext
struct CBaseFunction;
struct CClass;

bool ExecuteFunction(ScriptInstance aInstance, CBaseFunction* aFunc, void* aOut);
bool ExecuteFunction(ScriptInstance aInstance, CBaseFunction* aFunc, void* aOut, StackArgs_t& aArgs);

bool ExecuteFunction(CClass* aContext, CBaseFunction* aFunc, void* aOut, StackArgs_t& aArgs);
Expand Down
1 change: 1 addition & 0 deletions include/RED4ext/TweakDB.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ struct TweakDB
return &data;
}

#pragma warning(suppress : 4324)
T data;
};
using QuaternionFlatValue = FlatValueImpl<Quaternion, CName("Quaternion")>;
Expand Down

0 comments on commit 43b181a

Please sign in to comment.