Skip to content

Commit ecf5afe

Browse files
committed
use functions that exist
1 parent 7b44e8f commit ecf5afe

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ void CLuaVehicleDefs::LoadFunctions()
156156
{"setVehicleWheelScale", ArgumentParser<SetVehicleWheelScale>},
157157
{"setVehicleModelWheelSize", ArgumentParser<SetVehicleModelWheelSize>},
158158
{"spawnVehicleFlyingComponent", ArgumentParser<SpawnVehicleFlyingComponent>},
159+
{"setPlaneTrailEnabled", ArgumentParser<SetSmokeTrailEnabled>},
160+
{"IsPlaneTrailEnabled", ArgumentParser<IsSmokeTrailEnabled>},
159161
};
160162

161163
// Add functions
@@ -4340,3 +4342,19 @@ bool CLuaVehicleDefs::SpawnVehicleFlyingComponent(CClientVehicle* const vehicle,
43404342

43414343
return vehicle->SpawnFlyingComponent(partNodeIndex, collisionType, removalTime.value_or(-1));
43424344
}
4345+
4346+
bool CLuaVehicleDefs::SetSmokeTrailEnabled(CClientVehicle* vehicle, bool state) noexcept
4347+
{
4348+
if (vehicle->GetModel() == 512 || vehicle->GetModel() == 513) // Support Cropduster and Stuntplane
4349+
{
4350+
vehicle->SetSmokeTrailEnabled(state);
4351+
return true;
4352+
}
4353+
return false;
4354+
}
4355+
4356+
bool CLuaVehicleDefs::IsSmokeTrailEnabled(CClientVehicle* vehicle) noexcept
4357+
{
4358+
return vehicle->IsSmokeTrailEnabled();
4359+
}
4360+

Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,7 @@ class CLuaVehicleDefs : public CLuaDefs
181181
LUA_DECLARE(GetVehicleComponents);
182182

183183
static bool SpawnVehicleFlyingComponent(CClientVehicle* const vehicle, std::uint8_t nodeIndex, std::optional<std::uint8_t> componentCollisionType, std::optional<std::uint32_t> removalTime);
184+
185+
static bool SetSmokeTrailEnabled(CClientVehicle* vehicle, bool state) noexcept;
186+
static bool IsSmokeTrailEnabled(CClientVehicle* vehicle) noexcept;
184187
};

0 commit comments

Comments
 (0)