Skip to content

Commit 54dc72a

Browse files
committed
Review
1 parent 185d10d commit 54dc72a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void CLuaPedDefs::LoadFunctions()
6262
{"setPedEnterVehicle", ArgumentParser<SetPedEnterVehicle>},
6363
{"setPedExitVehicle", ArgumentParser<SetPedExitVehicle>},
6464
{"setPedBleeding", ArgumentParser<SetPedBleeding>},
65-
{"pedSay", ArgumentParser<PedSay>},
65+
{"playPedVoiceLine", ArgumentParser<PlayPedVoiceLine>},
6666

6767
{"getPedVoice", GetPedVoice},
6868
{"getElementBonePosition", ArgumentParser<GetElementBonePosition>},
@@ -212,6 +212,7 @@ void CLuaPedDefs::AddClass(lua_State* luaVM)
212212
lua_classfunction(luaVM, "setEnterVehicle", "setPedEnterVehicle");
213213
lua_classfunction(luaVM, "setExitVehicle", "setPedExitVehicle");
214214
lua_classfunction(luaVM, "setBleeding", "setPedBleeding");
215+
lua_classfunction(luaVM, "playPedVoiceLine", "playVoiceLine");
215216

216217
lua_classvariable(luaVM, "vehicle", OOP_WarpPedIntoVehicle, GetPedOccupiedVehicle);
217218
lua_classvariable(luaVM, "vehicleSeat", NULL, "getPedOccupiedVehicleSeat");
@@ -2500,11 +2501,11 @@ bool CLuaPedDefs::killPedTask(CClientPed* ped, taskType taskType, std::uint8_t t
25002501
}
25012502
}
25022503

2503-
bool CLuaPedDefs::PedSay(CClientPed* ped, int speechId, std::optional<float> probabilty)
2504+
bool CLuaPedDefs::PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional<float> probabilty)
25042505
{
25052506
auto speechContextId = static_cast<ePedSpeechContext>(speechId);
25062507
if (speechContextId < ePedSpeechContext::NOTHING || speechContextId >= ePedSpeechContext::NUM_PED_CONTEXT)
2507-
return false;
2508+
throw LuaFunctionError("The argument speechId is invalid. The valid range is 0-359.");
25082509

25092510
if (probabilty.has_value() && probabilty < 0.0f)
25102511
return false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,5 @@ class CLuaPedDefs : public CLuaDefs
119119

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

122-
static bool PedSay(CClientPed* ped, int speechId, std::optional<float> probabilty);
122+
static bool PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional<float> probabilty);
123123
};

0 commit comments

Comments
 (0)