Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2510,14 +2510,14 @@ bool CLuaPedDefs::killPedTask(CClientPed* ped, taskType taskType, std::uint8_t t
}
}

void CLuaPedDefs::PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional<float> probabilty)
void CLuaPedDefs::PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional<float> probability)
{
auto speechContextId = static_cast<ePedSpeechContext>(speechId);
if (speechContextId < ePedSpeechContext::NOTHING || speechContextId >= ePedSpeechContext::NUM_PED_CONTEXT)
throw LuaFunctionError("The argument speechId is invalid. The valid range is 0-359.");

if (probabilty.has_value() && probabilty < 0.0f)
throw LuaFunctionError("The argument probabilty cannot have a negative value.");
if (probability.has_value() && probability < 0.0f)
throw LuaFunctionError("The argument probability cannot have a negative value.");

ped->Say(speechContextId, probabilty.value_or(1.0f));
ped->Say(speechContextId, probability.value_or(1.0f));
}
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,5 @@ class CLuaPedDefs : public CLuaDefs

static bool killPedTask(CClientPed* ped, taskType taskType, std::uint8_t taskNumber, std::optional<bool> gracefully);

static void PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional<float> probabilty);
static void PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional<float> probability);
};
Loading