[General] Rename BaseEvent's state into doorState & adjust related funcs

pull/163/head
David Cernat 8 years ago
parent e52823394c
commit 5038353792

@ -37,7 +37,7 @@ void WorldFunctions::AddWorldObject() noexcept
worldObject.count = tempWorldObject.count;
worldObject.goldValue = tempWorldObject.goldValue;
worldObject.scale = tempWorldObject.scale;
worldObject.state = tempWorldObject.state;
worldObject.doorState = tempWorldObject.doorState;
worldObject.lockLevel = tempWorldObject.lockLevel;
worldObject.pos = tempWorldObject.pos;
@ -97,9 +97,9 @@ void WorldFunctions::SetObjectScale(double scale) noexcept
tempWorldObject.scale = scale;
}
void WorldFunctions::SetObjectState(int state) noexcept
void WorldFunctions::SetObjectDoorState(int doorState) noexcept
{
tempWorldObject.state = state;
tempWorldObject.doorState = doorState;
}
void WorldFunctions::SetObjectLockLevel(int lockLevel) noexcept
@ -156,9 +156,9 @@ double WorldFunctions::GetObjectScale(unsigned int i) noexcept
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects.at(i).scale;
}
int WorldFunctions::GetObjectState(unsigned int i) noexcept
int WorldFunctions::GetObjectDoorState(unsigned int i) noexcept
{
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects.at(i).state;
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects.at(i).doorState;
}
int WorldFunctions::GetObjectLockLevel(unsigned int i) noexcept

@ -13,7 +13,7 @@
{"SetObjectCount", WorldFunctions::SetObjectCount},\
{"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\
{"SetObjectScale", WorldFunctions::SetObjectScale},\
{"SetObjectState", WorldFunctions::SetObjectState},\
{"SetObjectDoorState", WorldFunctions::SetObjectDoorState},\
{"SetObjectLockLevel", WorldFunctions::SetObjectLockLevel},\
{"SetObjectPosition", WorldFunctions::SetObjectPosition},\
{"SetObjectRotation", WorldFunctions::SetObjectRotation},\
@ -26,7 +26,7 @@
{"GetObjectCount", WorldFunctions::GetObjectCount},\
{"GetObjectGoldValue", WorldFunctions::GetObjectGoldValue},\
{"GetObjectScale", WorldFunctions::GetObjectScale},\
{"GetObjectState", WorldFunctions::GetObjectState},\
{"GetObjectDoorState", WorldFunctions::GetObjectDoorState},\
{"GetObjectLockLevel", WorldFunctions::GetObjectLockLevel},\
{"GetObjectPosX", WorldFunctions::GetObjectPosX},\
{"GetObjectPosY", WorldFunctions::GetObjectPosY},\
@ -61,7 +61,7 @@ public:
static void SetObjectCount(int count) noexcept;
static void SetObjectGoldValue(int goldValue) noexcept;
static void SetObjectScale(double scale) noexcept;
static void SetObjectState(int scale) noexcept;
static void SetObjectDoorState(int doorState) noexcept;
static void SetObjectLockLevel(int lockLevel) noexcept;
static void SetObjectPosition(double x, double y, double z) noexcept;
static void SetObjectRotation(double x, double y, double z) noexcept;
@ -74,7 +74,7 @@ public:
static int GetObjectCount(unsigned int i) noexcept;
static int GetObjectGoldValue(unsigned int i) noexcept;
static double GetObjectScale(unsigned int i) noexcept;
static int GetObjectState(unsigned int i) noexcept;
static int GetObjectDoorState(unsigned int i) noexcept;
static int GetObjectLockLevel(unsigned int i) noexcept;
static double GetObjectPosX(unsigned int i) noexcept;
static double GetObjectPosY(unsigned int i) noexcept;

@ -376,8 +376,8 @@ void WorldEvent::activateDoors(MWWorld::CellStore* cellStore)
ptrFound.getCellRef().getRefId().c_str(),
ptrFound.getCellRef().getRefNum());
ptrFound.getClass().setDoorState(ptrFound, worldObject.state);
MWBase::Environment::get().getWorld()->saveDoorState(ptrFound, worldObject.state);
ptrFound.getClass().setDoorState(ptrFound, worldObject.doorState);
MWBase::Environment::get().getWorld()->saveDoorState(ptrFound, worldObject.doorState);
}
}
}

@ -2272,7 +2272,7 @@ namespace MWWorld
mwmp::WorldObject worldObject;
worldObject.refId = door.getCellRef().getRefId();
worldObject.refNumIndex = door.getCellRef().getRefNum().mIndex;
worldObject.state = state;
worldObject.doorState = state;
event->addObject(worldObject);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->Send(event);
@ -2281,7 +2281,7 @@ namespace MWWorld
worldObject.refId.c_str(),
worldObject.refNumIndex,
event->cell.getDescription().c_str(),
worldObject.state ? "true" : "false");
worldObject.doorState ? "true" : "false");
delete event;
event = NULL;
@ -2299,7 +2299,7 @@ namespace MWWorld
mwmp::WorldObject worldObject;
worldObject.refId = door.getCellRef().getRefId();
worldObject.refNumIndex = door.getCellRef().getRefNum().mIndex;
worldObject.state = state;
worldObject.doorState = state;
event->addObject(worldObject);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->Send(event);
@ -2308,7 +2308,7 @@ namespace MWWorld
worldObject.refId.c_str(),
worldObject.refNumIndex,
event->cell.getDescription().c_str(),
worldObject.state ? "true" : "false");
worldObject.doorState ? "true" : "false");
delete event;
event = NULL;

@ -16,7 +16,7 @@ namespace mwmp
int goldValue;
ESM::Position pos;
int state;
int doorState;
int lockLevel;
float scale;

@ -35,7 +35,7 @@ void PacketDoorState::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send)
RW(worldObject.refId, send);
RW(worldObject.refNumIndex, send);
RW(worldObject.state, send);
RW(worldObject.doorState, send);
if (!send)
{

Loading…
Cancel
Save