Working on probe: drv_call_function now returns a string

This commit is contained in:
2024-09-04 21:01:20 -04:00
parent 9f0f96556f
commit 8c75a5f826
3 changed files with 13 additions and 2 deletions

View File

@@ -166,7 +166,7 @@ void AIntegrationGameModeBase::LuaCallInvoke(AActor *place) {
if (place != nullptr) { if (place != nullptr) {
place_id = UlxTangible::GetActorTangible(place)->TangibleId; place_id = UlxTangible::GetActorTangible(place)->TangibleId;
} }
w->play_call_function(w.Get(), InvocationKind::LUA_CALL, place_id, datapk.size(), datapk.data()); w.PlayCallFunction(InvocationKind::LUA_CALL, place_id, datapk);
} }
void AIntegrationGameModeBase::ExecuteDebuggingCommand(FlxLockedWrapper &w, const FString &fs) { void AIntegrationGameModeBase::ExecuteDebuggingCommand(FlxLockedWrapper &w, const FString &fs) {
@@ -183,7 +183,7 @@ void AIntegrationGameModeBase::ExecuteDebuggingCommand(FlxLockedWrapper &w, cons
sb.write_fvector(FVector(2,3,4)); sb.write_fvector(FVector(2,3,4));
std::string_view datapk = sb.view(); std::string_view datapk = sb.view();
int64 player = w.GetActor(); int64 player = w.GetActor();
w->play_call_function(w.Get(), InvocationKind::LUA_CALL, player, datapk.size(), datapk.data()); w.PlayCallFunction(InvocationKind::LUA_CALL, player, datapk);
} else { } else {
ConsoleOutput.AppendLine(TEXT("Unknown Command")); ConsoleOutput.AppendLine(TEXT("Unknown Command"));
} }

View File

@@ -50,6 +50,13 @@ IdView FlxLockedWrapper::GetNear(int64 id, double rx, double ry, double rz) {
return IdView(data, size); return IdView(data, size);
} }
std::string_view FlxLockedWrapper::PlayCallFunction(InvocationKind kind, int64 place, std::string_view datapk) {
uint32_t retpklen;
const char *retpk;
Lockable.Wrapper.play_call_function(Get(), kind, place, datapk.size(), datapk.data(), &retpklen, &retpk);
return std::string_view(retpk, retpklen);
}
StringViewVec FlxLockedWrapper::GetAnimationQueues(IdView ids) { StringViewVec FlxLockedWrapper::GetAnimationQueues(IdView ids) {
// How many animation queues are we fetching? // How many animation queues are we fetching?
int num = ids.Num(); int num = ids.Num();

View File

@@ -84,6 +84,10 @@ public:
// //
IdView GetNear(int64 id, double rx, double ry, double rz); IdView GetNear(int64 id, double rx, double ry, double rz);
// PlayCallFunction - a thin wrapper around play_call_function.
//
std::string_view PlayCallFunction(InvocationKind kind, int64 place, std::string_view datapk);
// Get animation queues. // Get animation queues.
// //
// The array returned by this is valid until the // The array returned by this is valid until the