forked from teamnwah/openmw-tes3coop
[General] Add and use isActor bool for WorldObject
This commit is contained in:
parent
9d2c5c3502
commit
de49f5f175
5 changed files with 12 additions and 0 deletions
|
@ -119,6 +119,11 @@ double WorldFunctions::GetObjectRotZ(unsigned int i) noexcept
|
|||
return readEvent->worldObjects.at(i).position.rot[2];
|
||||
}
|
||||
|
||||
bool WorldFunctions::GetObjectIsActor(unsigned int i) noexcept
|
||||
{
|
||||
return readEvent->worldObjects.at(i).isActor;
|
||||
}
|
||||
|
||||
unsigned int WorldFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
|
||||
{
|
||||
return readEvent->worldObjects.at(objectIndex).containerItemCount;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
{"GetObjectRotX", WorldFunctions::GetObjectRotX},\
|
||||
{"GetObjectRotY", WorldFunctions::GetObjectRotY},\
|
||||
{"GetObjectRotZ", WorldFunctions::GetObjectRotZ},\
|
||||
{"GetObjectIsActor", WorldFunctions::GetObjectIsActor},\
|
||||
\
|
||||
{"GetContainerChangesSize", WorldFunctions::GetContainerChangesSize},\
|
||||
{"GetContainerItemRefId", WorldFunctions::GetContainerItemRefId},\
|
||||
|
@ -89,6 +90,7 @@ public:
|
|||
static double GetObjectRotX(unsigned int i) noexcept;
|
||||
static double GetObjectRotY(unsigned int i) noexcept;
|
||||
static double GetObjectRotZ(unsigned int i) noexcept;
|
||||
static bool GetObjectIsActor(unsigned int i) noexcept;
|
||||
|
||||
static unsigned int GetContainerChangesSize(unsigned int objectIndex) noexcept;
|
||||
static const char *GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept;
|
||||
|
|
|
@ -471,6 +471,8 @@ void WorldEvent::addObjectPlace(const MWWorld::Ptr& ptr)
|
|||
// Get the real count of gold in a stack
|
||||
worldObject.goldValue = ptr.getCellRef().getGoldValue();
|
||||
|
||||
worldObject.isActor = ptr.getClass().isActor();
|
||||
|
||||
addObject(worldObject);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,8 @@ namespace mwmp
|
|||
float floatVal;
|
||||
std::string varName;
|
||||
|
||||
bool isActor;
|
||||
|
||||
std::vector<ContainerItem> containerItems;
|
||||
unsigned int containerItemCount;
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@ void PacketObjectPlace::Packet(RakNet::BitStream *bs, bool send)
|
|||
RW(worldObject.charge, send);
|
||||
RW(worldObject.goldValue, send);
|
||||
RW(worldObject.position, send);
|
||||
RW(worldObject.isActor, send);
|
||||
|
||||
if (!send)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue