[Server] Add GetContainerItemActionCount() for getting drag count

pull/163/head
David Cernat 8 years ago
parent 4f2b88df8a
commit b1009ad33d

@ -138,6 +138,12 @@ int WorldFunctions::GetContainerItemGoldValue(unsigned int objectIndex, unsigned
.containerChanges.items.at(itemIndex).goldValue; .containerChanges.items.at(itemIndex).goldValue;
} }
int WorldFunctions::GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept
{
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects.at(objectIndex)
.containerChanges.items.at(itemIndex).actionCount;
}
void WorldFunctions::SetBaseEventCell(const char* cellDescription) noexcept void WorldFunctions::SetBaseEventCell(const char* cellDescription) noexcept
{ {
std::string description = cellDescription; std::string description = cellDescription;

@ -2,64 +2,65 @@
#define OPENMW_WORLD_HPP #define OPENMW_WORLD_HPP
#define WORLDFUNCTIONS \ #define WORLDFUNCTIONS \
{"CreateBaseEvent", WorldFunctions::CreateBaseEvent},\ {"CreateBaseEvent", WorldFunctions::CreateBaseEvent},\
\ \
{"GetObjectChangesSize", WorldFunctions::GetObjectChangesSize},\ {"GetObjectChangesSize", WorldFunctions::GetObjectChangesSize},\
{"GetBaseEventAction", WorldFunctions::GetBaseEventAction},\ {"GetBaseEventAction", WorldFunctions::GetBaseEventAction},\
\ \
{"GetObjectRefId", WorldFunctions::GetObjectRefId},\ {"GetObjectRefId", WorldFunctions::GetObjectRefId},\
{"GetObjectRefNumIndex", WorldFunctions::GetObjectRefNumIndex},\ {"GetObjectRefNumIndex", WorldFunctions::GetObjectRefNumIndex},\
{"GetObjectCount", WorldFunctions::GetObjectCount},\ {"GetObjectCount", WorldFunctions::GetObjectCount},\
{"GetObjectCharge", WorldFunctions::GetObjectCharge},\ {"GetObjectCharge", WorldFunctions::GetObjectCharge},\
{"GetObjectGoldValue", WorldFunctions::GetObjectGoldValue},\ {"GetObjectGoldValue", WorldFunctions::GetObjectGoldValue},\
{"GetObjectScale", WorldFunctions::GetObjectScale},\ {"GetObjectScale", WorldFunctions::GetObjectScale},\
{"GetObjectDoorState", WorldFunctions::GetObjectDoorState},\ {"GetObjectDoorState", WorldFunctions::GetObjectDoorState},\
{"GetObjectLockLevel", WorldFunctions::GetObjectLockLevel},\ {"GetObjectLockLevel", WorldFunctions::GetObjectLockLevel},\
{"GetObjectPosX", WorldFunctions::GetObjectPosX},\ {"GetObjectPosX", WorldFunctions::GetObjectPosX},\
{"GetObjectPosY", WorldFunctions::GetObjectPosY},\ {"GetObjectPosY", WorldFunctions::GetObjectPosY},\
{"GetObjectPosZ", WorldFunctions::GetObjectPosZ},\ {"GetObjectPosZ", WorldFunctions::GetObjectPosZ},\
{"GetObjectRotX", WorldFunctions::GetObjectRotX},\ {"GetObjectRotX", WorldFunctions::GetObjectRotX},\
{"GetObjectRotY", WorldFunctions::GetObjectRotY},\ {"GetObjectRotY", WorldFunctions::GetObjectRotY},\
{"GetObjectRotZ", WorldFunctions::GetObjectRotZ},\ {"GetObjectRotZ", WorldFunctions::GetObjectRotZ},\
\ \
{"GetContainerChangesSize", WorldFunctions::GetContainerChangesSize},\ {"GetContainerChangesSize", WorldFunctions::GetContainerChangesSize},\
{"GetContainerItemRefId", WorldFunctions::GetContainerItemRefId},\ {"GetContainerItemRefId", WorldFunctions::GetContainerItemRefId},\
{"GetContainerItemCount", WorldFunctions::GetContainerItemCount},\ {"GetContainerItemCount", WorldFunctions::GetContainerItemCount},\
{"GetContainerItemCharge", WorldFunctions::GetContainerItemCharge},\ {"GetContainerItemCharge", WorldFunctions::GetContainerItemCharge},\
{"GetContainerItemGoldValue", WorldFunctions::GetContainerItemGoldValue},\ {"GetContainerItemGoldValue", WorldFunctions::GetContainerItemGoldValue},\
{"GetContainerItemActionCount", WorldFunctions::GetContainerItemActionCount},\
\ \
{"SetBaseEventCell", WorldFunctions::SetBaseEventCell},\ {"SetBaseEventCell", WorldFunctions::SetBaseEventCell},\
{"SetBaseEventAction", WorldFunctions::SetBaseEventAction},\ {"SetBaseEventAction", WorldFunctions::SetBaseEventAction},\
\ \
{"SetObjectRefId", WorldFunctions::SetObjectRefId},\ {"SetObjectRefId", WorldFunctions::SetObjectRefId},\
{"SetObjectRefNumIndex", WorldFunctions::SetObjectRefNumIndex},\ {"SetObjectRefNumIndex", WorldFunctions::SetObjectRefNumIndex},\
{"SetObjectCount", WorldFunctions::SetObjectCount},\ {"SetObjectCount", WorldFunctions::SetObjectCount},\
{"SetObjectCharge", WorldFunctions::SetObjectCharge},\ {"SetObjectCharge", WorldFunctions::SetObjectCharge},\
{"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\ {"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\
{"SetObjectScale", WorldFunctions::SetObjectScale},\ {"SetObjectScale", WorldFunctions::SetObjectScale},\
{"SetObjectDoorState", WorldFunctions::SetObjectDoorState},\ {"SetObjectDoorState", WorldFunctions::SetObjectDoorState},\
{"SetObjectLockLevel", WorldFunctions::SetObjectLockLevel},\ {"SetObjectLockLevel", WorldFunctions::SetObjectLockLevel},\
{"SetObjectPosition", WorldFunctions::SetObjectPosition},\ {"SetObjectPosition", WorldFunctions::SetObjectPosition},\
{"SetObjectRotation", WorldFunctions::SetObjectRotation},\ {"SetObjectRotation", WorldFunctions::SetObjectRotation},\
\ \
{"SetContainerItemRefId", WorldFunctions::SetContainerItemRefId},\ {"SetContainerItemRefId", WorldFunctions::SetContainerItemRefId},\
{"SetContainerItemCount", WorldFunctions::SetContainerItemCount},\ {"SetContainerItemCount", WorldFunctions::SetContainerItemCount},\
{"SetContainerItemCharge", WorldFunctions::SetContainerItemCharge},\ {"SetContainerItemCharge", WorldFunctions::SetContainerItemCharge},\
\ \
{"AddWorldObject", WorldFunctions::AddWorldObject},\ {"AddWorldObject", WorldFunctions::AddWorldObject},\
{"AddContainerItem", WorldFunctions::AddContainerItem},\ {"AddContainerItem", WorldFunctions::AddContainerItem},\
\ \
{"SendObjectDelete", WorldFunctions::SendObjectDelete},\ {"SendObjectDelete", WorldFunctions::SendObjectDelete},\
{"SendObjectPlace", WorldFunctions::SendObjectPlace},\ {"SendObjectPlace", WorldFunctions::SendObjectPlace},\
{"SendObjectScale", WorldFunctions::SendObjectScale},\ {"SendObjectScale", WorldFunctions::SendObjectScale},\
{"SendObjectLock", WorldFunctions::SendObjectLock},\ {"SendObjectLock", WorldFunctions::SendObjectLock},\
{"SendObjectUnlock", WorldFunctions::SendObjectUnlock},\ {"SendObjectUnlock", WorldFunctions::SendObjectUnlock},\
{"SendDoorState", WorldFunctions::SendDoorState},\ {"SendDoorState", WorldFunctions::SendDoorState},\
{"SendContainer", WorldFunctions::SendContainer},\ {"SendContainer", WorldFunctions::SendContainer},\
\ \
{"SetHour", WorldFunctions::SetHour},\ {"SetHour", WorldFunctions::SetHour},\
{"SetMonth", WorldFunctions::SetMonth},\ {"SetMonth", WorldFunctions::SetMonth},\
{"SetDay", WorldFunctions::SetDay} {"SetDay", WorldFunctions::SetDay}
class WorldFunctions class WorldFunctions
{ {
@ -90,6 +91,7 @@ public:
static int GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept; static int GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept;
static int GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept; static int GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept;
static int GetContainerItemGoldValue(unsigned int objectIndex, unsigned int itemIndex) noexcept; static int GetContainerItemGoldValue(unsigned int objectIndex, unsigned int itemIndex) noexcept;
static int GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept;
static void SetBaseEventCell(const char* cellDescription) noexcept; static void SetBaseEventCell(const char* cellDescription) noexcept;
static void SetBaseEventAction(int action) noexcept; static void SetBaseEventAction(int action) noexcept;

Loading…
Cancel
Save