mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 08:00:56 -04:00
[Server] Add server functions for handling the droppedByPlayer boolean
This commit is contained in:
parent
8b2bf941cd
commit
1a7060c5c5
@ -380,6 +380,11 @@ bool ObjectFunctions::DoesObjectHaveContainer(unsigned int index) noexcept
|
|||||||
return readObjectList->baseObjects.at(index).hasContainer;
|
return readObjectList->baseObjects.at(index).hasContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ObjectFunctions::IsObjectDroppedByPlayer(unsigned int index) noexcept
|
||||||
|
{
|
||||||
|
return readObjectList->baseObjects.at(index).droppedByPlayer;
|
||||||
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SetObjectListCell(const char* cellDescription) noexcept
|
void ObjectFunctions::SetObjectListCell(const char* cellDescription) noexcept
|
||||||
{
|
{
|
||||||
writeObjectList.cell = Utils::getCellFromDescription(cellDescription);
|
writeObjectList.cell = Utils::getCellFromDescription(cellDescription);
|
||||||
@ -455,6 +460,11 @@ void ObjectFunctions::SetObjectDisarmState(bool disarmState) noexcept
|
|||||||
tempObject.isDisarmed = disarmState;
|
tempObject.isDisarmed = disarmState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectFunctions::SetObjectDroppedByPlayerState(bool droppedByPlayer) noexcept
|
||||||
|
{
|
||||||
|
tempObject.droppedByPlayer = droppedByPlayer;
|
||||||
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SetObjectPosition(double x, double y, double z) noexcept
|
void ObjectFunctions::SetObjectPosition(double x, double y, double z) noexcept
|
||||||
{
|
{
|
||||||
tempObject.position.pos[0] = x;
|
tempObject.position.pos[0] = x;
|
||||||
@ -598,7 +608,6 @@ void ObjectFunctions::SetContainerItemActionCountByIndex(unsigned int objectInde
|
|||||||
|
|
||||||
void ObjectFunctions::AddObject() noexcept
|
void ObjectFunctions::AddObject() noexcept
|
||||||
{
|
{
|
||||||
tempObject.droppedByPlayer = false;
|
|
||||||
writeObjectList.baseObjects.push_back(tempObject);
|
writeObjectList.baseObjects.push_back(tempObject);
|
||||||
|
|
||||||
tempObject = emptyObject;
|
tempObject = emptyObject;
|
||||||
|
@ -80,6 +80,7 @@
|
|||||||
{"GetContainerItemActionCount", ObjectFunctions::GetContainerItemActionCount},\
|
{"GetContainerItemActionCount", ObjectFunctions::GetContainerItemActionCount},\
|
||||||
\
|
\
|
||||||
{"DoesObjectHaveContainer", ObjectFunctions::DoesObjectHaveContainer},\
|
{"DoesObjectHaveContainer", ObjectFunctions::DoesObjectHaveContainer},\
|
||||||
|
{"IsObjectDroppedByPlayer", ObjectFunctions::IsObjectDroppedByPlayer},\
|
||||||
\
|
\
|
||||||
{"SetObjectListCell", ObjectFunctions::SetObjectListCell},\
|
{"SetObjectListCell", ObjectFunctions::SetObjectListCell},\
|
||||||
{"SetObjectListAction", ObjectFunctions::SetObjectListAction},\
|
{"SetObjectListAction", ObjectFunctions::SetObjectListAction},\
|
||||||
@ -97,6 +98,7 @@
|
|||||||
{"SetObjectState", ObjectFunctions::SetObjectState},\
|
{"SetObjectState", ObjectFunctions::SetObjectState},\
|
||||||
{"SetObjectLockLevel", ObjectFunctions::SetObjectLockLevel},\
|
{"SetObjectLockLevel", ObjectFunctions::SetObjectLockLevel},\
|
||||||
{"SetObjectDisarmState", ObjectFunctions::SetObjectDisarmState},\
|
{"SetObjectDisarmState", ObjectFunctions::SetObjectDisarmState},\
|
||||||
|
{"SetObjectDroppedByPlayerState", ObjectFunctions::SetObjectDroppedByPlayerState},\
|
||||||
{"SetObjectPosition", ObjectFunctions::SetObjectPosition},\
|
{"SetObjectPosition", ObjectFunctions::SetObjectPosition},\
|
||||||
{"SetObjectRotation", ObjectFunctions::SetObjectRotation},\
|
{"SetObjectRotation", ObjectFunctions::SetObjectRotation},\
|
||||||
\
|
\
|
||||||
@ -732,6 +734,17 @@ public:
|
|||||||
*/
|
*/
|
||||||
static bool DoesObjectHaveContainer(unsigned int index) noexcept;
|
static bool DoesObjectHaveContainer(unsigned int index) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check whether the object at a certain index in the read object list has been
|
||||||
|
* dropped by a player.
|
||||||
|
*
|
||||||
|
* Note: Only ObjectLists from ObjectPlace packets contain this information.
|
||||||
|
*
|
||||||
|
* \param index The index of the object.
|
||||||
|
* \return Whether the object has been dropped by a player.
|
||||||
|
*/
|
||||||
|
static bool IsObjectDroppedByPlayer(unsigned int index) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set the cell of the temporary object list stored on the server.
|
* \brief Set the cell of the temporary object list stored on the server.
|
||||||
*
|
*
|
||||||
@ -883,6 +896,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void SetObjectDisarmState(bool disarmState) noexcept;
|
static void SetObjectDisarmState(bool disarmState) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set the droppedByPlayer state of the temporary object stored on the server.
|
||||||
|
*
|
||||||
|
* \param droppedByPlayer Whether the object has been dropped by a player or not.
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
static void SetObjectDroppedByPlayerState(bool dropedByPlayerState) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set the position of the temporary object stored on the server.
|
* \brief Set the position of the temporary object stored on the server.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user