[General] Add and use isActor bool for WorldObject

0.6.1
David Cernat 8 years ago
parent 9d2c5c3502
commit de49f5f175

@ -119,6 +119,11 @@ double WorldFunctions::GetObjectRotZ(unsigned int i) noexcept
return readEvent->worldObjects.at(i).position.rot[2]; 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 unsigned int WorldFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
{ {
return readEvent->worldObjects.at(objectIndex).containerItemCount; return readEvent->worldObjects.at(objectIndex).containerItemCount;

@ -23,6 +23,7 @@
{"GetObjectRotX", WorldFunctions::GetObjectRotX},\ {"GetObjectRotX", WorldFunctions::GetObjectRotX},\
{"GetObjectRotY", WorldFunctions::GetObjectRotY},\ {"GetObjectRotY", WorldFunctions::GetObjectRotY},\
{"GetObjectRotZ", WorldFunctions::GetObjectRotZ},\ {"GetObjectRotZ", WorldFunctions::GetObjectRotZ},\
{"GetObjectIsActor", WorldFunctions::GetObjectIsActor},\
\ \
{"GetContainerChangesSize", WorldFunctions::GetContainerChangesSize},\ {"GetContainerChangesSize", WorldFunctions::GetContainerChangesSize},\
{"GetContainerItemRefId", WorldFunctions::GetContainerItemRefId},\ {"GetContainerItemRefId", WorldFunctions::GetContainerItemRefId},\
@ -89,6 +90,7 @@ public:
static double GetObjectRotX(unsigned int i) noexcept; static double GetObjectRotX(unsigned int i) noexcept;
static double GetObjectRotY(unsigned int i) noexcept; static double GetObjectRotY(unsigned int i) noexcept;
static double GetObjectRotZ(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 unsigned int GetContainerChangesSize(unsigned int objectIndex) noexcept;
static const char *GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) 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 // Get the real count of gold in a stack
worldObject.goldValue = ptr.getCellRef().getGoldValue(); worldObject.goldValue = ptr.getCellRef().getGoldValue();
worldObject.isActor = ptr.getClass().isActor();
addObject(worldObject); addObject(worldObject);
} }

@ -47,6 +47,8 @@ namespace mwmp
float floatVal; float floatVal;
std::string varName; std::string varName;
bool isActor;
std::vector<ContainerItem> containerItems; std::vector<ContainerItem> containerItems;
unsigned int containerItemCount; unsigned int containerItemCount;
}; };

@ -40,6 +40,7 @@ void PacketObjectPlace::Packet(RakNet::BitStream *bs, bool send)
RW(worldObject.charge, send); RW(worldObject.charge, send);
RW(worldObject.goldValue, send); RW(worldObject.goldValue, send);
RW(worldObject.position, send); RW(worldObject.position, send);
RW(worldObject.isActor, send);
if (!send) if (!send)
{ {

Loading…
Cancel
Save