Skip to content

Commit

Permalink
update to latest sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Sep 19, 2023
1 parent 4130cbd commit bcd23a3
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 27 deletions.
8 changes: 4 additions & 4 deletions c-api/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion c-api/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
43 changes: 24 additions & 19 deletions c-api/data/vehicle_model_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -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;
}
};
};
4 changes: 2 additions & 2 deletions c-api/func_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ inline uint64_t capiHashes[] = {
6921054663232355759UL,
7482854450085275693UL,
2139798095052897524UL,
15652019729912249391UL,
8454955647873390265UL,
5411021830103603795UL,
6799731000550763773UL,
Expand Down Expand Up @@ -1332,7 +1333,6 @@ inline uint64_t capiHashes[] = {
8442828755754917489UL,
5757616980701278724UL,
9990683150417934189UL,
15652019729912249391UL,
7718568480211772772UL,
12125306445698504265UL,
14723504540957489106UL,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cpp-sdk

0 comments on commit bcd23a3

Please sign in to comment.