Skip to content

Commit ccdd95d

Browse files
Improve mvalue pointers for windows
1 parent a621762 commit ccdd95d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

runtime/src/altv-c-api/mvalue.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ void* MValue_GetEntity(alt::MValue &mValue, alt::IBaseObject::Type &type) {
116116
return nullptr;
117117
}
118118

119-
MValueFunctionCallback MValue_GetFunction(alt::MValueFunction &mValue) {
120-
//TODO: find better way, this only works for c# module invokers
121-
return ((CustomInvoker*) mValue.GetInvoker())->mValueFunctionCallback;
119+
MValueFunctionCallback MValue_GetFunction(alt::MValue &mValue) {
120+
auto fn = mValue.Get<alt::MValue::Function>();
121+
return ((CustomInvoker*) static_cast<alt::MValueFunction::Invoker*>(fn.invoker))->mValueFunctionCallback;
122122
}
123123

124124
/*alt::MValueFunction::Invoker* MValue_GetInvoker(alt::MValueFunction &mValue) {

runtime/src/altv-c-api/mvalue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ EXPORT void MValue_GetString(alt::MValue &mValue, const char*&value, uint64_t &s
4242
EXPORT void MValue_GetList(alt::MValue &mValue, alt::MValue::List &value);
4343
EXPORT void MValue_GetDict(alt::MValue &mValue, alt::Array<alt::String> &keys, alt::MValue::List &values);
4444
EXPORT void* MValue_GetEntity(alt::MValue &mValue, alt::IBaseObject::Type &type);
45-
EXPORT MValueFunctionCallback MValue_GetFunction(alt::MValueFunction &mValue);
45+
EXPORT MValueFunctionCallback MValue_GetFunction(alt::MValue &mValue);
4646

4747
EXPORT void MValue_CallFunction(alt::MValue* mValue, alt::MValue* args, int32_t size, alt::MValue &result);
4848
EXPORT void MValue_CallFunctionValue(alt::MValueFunction &mValue, alt::MValueList &value, alt::MValue &result);

runtime/src/altv-c-api/resource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bool Resource_GetExport(alt::IResource* resource, const char* key, alt::MValue &
2424
std::cout << "not found key" << std::endl;
2525
return false;
2626
}
27-
value = resource->GetExports()[key];//dictValue->second
27+
value = dictValue->second;
2828
return true;
2929
}
3030

0 commit comments

Comments
 (0)