[Server] Add deprecated alternatives for ObjectList functions

This will avoid server crashes in older scripts.
sol2-server-rewrite
David Cernat 7 years ago
parent 51698bed48
commit 2ac334664b

@ -449,3 +449,45 @@ void ObjectFunctions::SendConsoleCommand(bool broadcast) noexcept
if (broadcast)
packet->Send(true);
}
// All methods below are deprecated versions of methods from above
void ObjectFunctions::ReadLastEvent() noexcept
{
ReadLastObjectList();
}
void ObjectFunctions::InitializeEvent(unsigned short pid) noexcept
{
InitializeObjectList(pid);
}
unsigned char ObjectFunctions::GetEventAction() noexcept
{
return GetObjectListAction();
}
unsigned char ObjectFunctions::GetEventContainerSubAction() noexcept
{
return GetObjectListContainerSubAction();
}
void ObjectFunctions::SetEventCell(const char* cellDescription) noexcept
{
SetObjectListCell(cellDescription);
}
void ObjectFunctions::SetEventAction(unsigned char action) noexcept
{
SetObjectListAction(action);
}
void ObjectFunctions::SetEventConsoleCommand(const char* consoleCommand) noexcept
{
SetObjectListConsoleCommand(consoleCommand);
}
void ObjectFunctions::AddWorldObject() noexcept
{
AddObject();
}

@ -81,7 +81,16 @@
{"SendDoorState", ObjectFunctions::SendDoorState},\
{"SendDoorDestination", ObjectFunctions::SendDoorDestination},\
{"SendContainer", ObjectFunctions::SendContainer},\
{"SendConsoleCommand", ObjectFunctions::SendConsoleCommand}
{"SendConsoleCommand", ObjectFunctions::SendConsoleCommand},\
\
{"ReadLastEvent", ObjectFunctions::ReadLastEvent},\
{"InitializeEvent", ObjectFunctions::InitializeEvent},\
{"GetEventAction", ObjectFunctions::GetEventAction},\
{"GetEventContainerSubAction", ObjectFunctions::GetEventContainerSubAction},\
{"SetEventCell", ObjectFunctions::SetEventCell},\
{"SetEventAction", ObjectFunctions::SetEventAction},\
{"SetEventConsoleCommand", ObjectFunctions::SetEventConsoleCommand},\
{"AddWorldObject", ObjectFunctions::AddWorldObject}
class ObjectFunctions
{
@ -747,6 +756,18 @@ public:
*/
static void SendConsoleCommand(bool broadcast = false) noexcept;
// All methods below are deprecated versions of methods from above
static void ReadLastEvent() noexcept;
static void InitializeEvent(unsigned short pid) noexcept;
static unsigned char GetEventAction() noexcept;
static unsigned char GetEventContainerSubAction() noexcept;
static void SetEventCell(const char* cellDescription) noexcept;
static void SetEventAction(unsigned char action) noexcept;
static void SetEventConsoleCommand(const char* consoleCommand) noexcept;
static void AddWorldObject() noexcept;
};

Loading…
Cancel
Save