Skip to content

Commit b615358

Browse files
committed
add optional to last arg
1 parent df9b421 commit b615358

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,15 +2495,15 @@ bool CLuaPedDefs::SetPedExitVehicle(CClientPed* pPed)
24952495
return pPed->ExitVehicle();
24962496
}
24972497

2498-
bool CLuaPedDefs::killPedTask(CClientPed* ped, std::string taskType, std::uint8_t taskNumber, bool gracefully) noexcept
2498+
bool CLuaPedDefs::killPedTask(CClientPed* ped, std::string taskType, std::uint8_t taskNumber, std::optional<bool> gracefully) noexcept
24992499
{
25002500
if (taskType == "primary") // PRIMARY
25012501
{
2502-
return ped->KillTask(taskNumber, gracefully);
2502+
return ped->KillTask(taskNumber, gracefully.value_or(true));
25032503
}
25042504
else if (taskType == "secondary") // SECONDARY
25052505
{
2506-
return ped->KillTaskSecondary(taskNumber, gracefully);
2506+
return ped->KillTaskSecondary(taskNumber, gracefully.value_or(true));
25072507
}
25082508

25092509
return false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,5 @@ class CLuaPedDefs : public CLuaDefs
116116
static bool IsPedBleeding(CClientPed* ped);
117117
static bool SetPedBleeding(CClientPed* ped, bool bleeding);
118118

119-
static bool killPedTask(CClientPed* ped, std::string taskType, std::uint8_t taskNumber, bool gracefully) noexcept;
119+
static bool killPedTask(CClientPed* ped, std::string taskType, std::uint8_t taskNumber, std::optional<bool> gracefully) noexcept;
120120
};

0 commit comments

Comments
 (0)