diff --git a/c-api/core.cpp b/c-api/core.cpp index 1412ecc..5c50759 100644 --- a/c-api/core.cpp +++ b/c-api/core.cpp @@ -468,6 +468,10 @@ alt::IColShape* Core_CreateColShapePolygon(alt::ICore* core, float minZ, float m return colShape; } +int32_t Core_GetNetTime(alt::ICore* core) { + return core->GetNetTime(); +} + #ifdef ALT_SERVER_API uint8_t Core_SubscribeCommand(alt::ICore* core, const char* cmd, alt::CommandCallback cb) { return core->SubscribeCommand(cmd, cb); @@ -685,10 +689,6 @@ void Core_DestroyColShape(alt::ICore* core, alt::IColShape* baseObject) { return core->DestroyBaseObject(baseObject); } -int32_t Core_GetNetTime(alt::ICore* core) { - return core->GetNetTime(); -} - const char* Core_GetRootDirectory(alt::ICore* core, int32_t& size) { return AllocateString(core->GetRootDirectory(), size); } diff --git a/c-api/core.h b/c-api/core.h index 46779fa..48e4513 100644 --- a/c-api/core.h +++ b/c-api/core.h @@ -114,7 +114,7 @@ EXPORT_SERVER void Core_DestroyVehicle(alt::ICore* server, alt::IVehicle* baseOb EXPORT_SERVER void Core_DestroyCheckpoint(alt::ICore* server, alt::ICheckpoint* baseObject); EXPORT_SERVER void Core_DestroyVoiceChannel(alt::ICore* server, alt::IVoiceChannel* baseObject); EXPORT_SERVER void Core_DestroyColShape(alt::ICore* server, alt::IColShape* baseObject); -EXPORT_SERVER int32_t Core_GetNetTime(alt::ICore* server); +EXPORT_SHARED int32_t Core_GetNetTime(alt::ICore* server); EXPORT_SERVER const char* Core_GetRootDirectory(alt::ICore* server, int32_t& size); EXPORT_SERVER void Core_StartResource(alt::ICore* server, const char* text); EXPORT_SERVER void Core_StopResource(alt::ICore* server, const char* text); diff --git a/c-api/data/vehicle_model_info.h b/c-api/data/vehicle_model_info.h index c8fe491..84560f3 100644 --- a/c-api/data/vehicle_model_info.h +++ b/c-api/data/vehicle_model_info.h @@ -3,7 +3,8 @@ #include "cpp-sdk/ICore.h" #include "bone_info.h" -struct ClrVehicleModelInfo { +struct ClrVehicleModelInfo +{ char* title = nullptr; alt::VehicleModelInfo::Type modelType; uint8_t wheelsCount; @@ -24,26 +25,28 @@ struct ClrVehicleModelInfo { uint32_t boneSize; uint8_t canAttachCars; + uint32_t handlingNameHash; ClrVehicleModelInfo() = default; ClrVehicleModelInfo(alt::VehicleModelInfo info) : - modelType(info.modelType), - wheelsCount(info.wheelsCount), - hasArmoredWindows(info.hasArmoredWindows), - primaryColor(info.primaryColor), - secondaryColor(info.secondaryColor), - pearlColor(info.pearlColor), - wheelsColor(info.wheelsColor), - interiorColor(info.interiorColor), - dashboardColor(info.dashboardColor), - extras(info.extras), - defaultExtras(info.defaultExtras), - hasAutoAttachTrailer(info.hasAutoAttachTrailer), - canAttachCars(info.canAttachCars){ - + modelType(info.modelType), + wheelsCount(info.wheelsCount), + hasArmoredWindows(info.hasArmoredWindows), + primaryColor(info.primaryColor), + secondaryColor(info.secondaryColor), + pearlColor(info.pearlColor), + wheelsColor(info.wheelsColor), + interiorColor(info.interiorColor), + dashboardColor(info.dashboardColor), + extras(info.extras), + defaultExtras(info.defaultExtras), + hasAutoAttachTrailer(info.hasAutoAttachTrailer), + canAttachCars(info.canAttachCars), + handlingNameHash(info.handlingNameHash) + { size_t modkitsSize = std::size(info.modkits); - for(size_t i = 0; i < modkitsSize; i++) + for (size_t i = 0; i < modkitsSize; i++) { modkits[i] = info.modkits[i] != 0xFFFF; } @@ -54,12 +57,14 @@ struct ClrVehicleModelInfo { const auto vehModelBones = info.bones; boneSize = vehModelBones.size(); bones = new ClrBoneInfo[boneSize]; - for (uint32_t i = 0; i < boneSize; i++) { + for (uint32_t i = 0; i < boneSize; i++) + { bones[i] = ClrBoneInfo(vehModelBones[i]); } } - ~ClrVehicleModelInfo() { + ~ClrVehicleModelInfo() + { delete[] title; } -}; \ No newline at end of file +}; diff --git a/c-api/func_table.cpp b/c-api/func_table.cpp index 22deb47..020a425 100644 --- a/c-api/func_table.cpp +++ b/c-api/func_table.cpp @@ -1052,6 +1052,7 @@ inline uint64_t capiHashes[] = { 6921054663232355759UL, 7482854450085275693UL, 2139798095052897524UL, + 15652019729912249391UL, 8454955647873390265UL, 5411021830103603795UL, 6799731000550763773UL, @@ -1332,7 +1333,6 @@ inline uint64_t capiHashes[] = { 8442828755754917489UL, 5757616980701278724UL, 9990683150417934189UL, - 15652019729912249391UL, 7718568480211772772UL, 12125306445698504265UL, 14723504540957489106UL, @@ -2775,6 +2775,7 @@ inline void* capiPointers[] = { (void*) Core_GetEventEnumSize, (void*) Core_GetMarkers, (void*) Core_GetMetaData, + (void*) Core_GetNetTime, (void*) Core_GetNetworkObjects, (void*) Core_GetPeds, (void*) Core_GetPlayers, @@ -3055,7 +3056,6 @@ inline void* capiPointers[] = { (void*) Core_GetMigrationDistance, (void*) Core_GetMigrationThreadCount, (void*) Core_GetMigrationTickRate, - (void*) Core_GetNetTime, (void*) Core_GetPedModelInfo, (void*) Core_GetRootDirectory, (void*) Core_GetServerConfig, diff --git a/cpp-sdk b/cpp-sdk index d5ad9b4..c6cb971 160000 --- a/cpp-sdk +++ b/cpp-sdk @@ -1 +1 @@ -Subproject commit d5ad9b4eaf2a1b31cd2be20ebdfe576bc13b9187 +Subproject commit c6cb971264871a6826062c9c1fa7983214872cf7