mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:23:52 +00:00
[General] Rename BaseEvent's state into doorState & adjust related funcs
This commit is contained in:
parent
e52823394c
commit
5038353792
6 changed files with 17 additions and 17 deletions
|
@ -37,7 +37,7 @@ void WorldFunctions::AddWorldObject() noexcept
|
||||||
worldObject.count = tempWorldObject.count;
|
worldObject.count = tempWorldObject.count;
|
||||||
worldObject.goldValue = tempWorldObject.goldValue;
|
worldObject.goldValue = tempWorldObject.goldValue;
|
||||||
worldObject.scale = tempWorldObject.scale;
|
worldObject.scale = tempWorldObject.scale;
|
||||||
worldObject.state = tempWorldObject.state;
|
worldObject.doorState = tempWorldObject.doorState;
|
||||||
worldObject.lockLevel = tempWorldObject.lockLevel;
|
worldObject.lockLevel = tempWorldObject.lockLevel;
|
||||||
worldObject.pos = tempWorldObject.pos;
|
worldObject.pos = tempWorldObject.pos;
|
||||||
|
|
||||||
|
@ -97,9 +97,9 @@ void WorldFunctions::SetObjectScale(double scale) noexcept
|
||||||
tempWorldObject.scale = scale;
|
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
|
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;
|
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
|
int WorldFunctions::GetObjectLockLevel(unsigned int i) noexcept
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
{"SetObjectCount", WorldFunctions::SetObjectCount},\
|
{"SetObjectCount", WorldFunctions::SetObjectCount},\
|
||||||
{"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\
|
{"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\
|
||||||
{"SetObjectScale", WorldFunctions::SetObjectScale},\
|
{"SetObjectScale", WorldFunctions::SetObjectScale},\
|
||||||
{"SetObjectState", WorldFunctions::SetObjectState},\
|
{"SetObjectDoorState", WorldFunctions::SetObjectDoorState},\
|
||||||
{"SetObjectLockLevel", WorldFunctions::SetObjectLockLevel},\
|
{"SetObjectLockLevel", WorldFunctions::SetObjectLockLevel},\
|
||||||
{"SetObjectPosition", WorldFunctions::SetObjectPosition},\
|
{"SetObjectPosition", WorldFunctions::SetObjectPosition},\
|
||||||
{"SetObjectRotation", WorldFunctions::SetObjectRotation},\
|
{"SetObjectRotation", WorldFunctions::SetObjectRotation},\
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
{"GetObjectCount", WorldFunctions::GetObjectCount},\
|
{"GetObjectCount", WorldFunctions::GetObjectCount},\
|
||||||
{"GetObjectGoldValue", WorldFunctions::GetObjectGoldValue},\
|
{"GetObjectGoldValue", WorldFunctions::GetObjectGoldValue},\
|
||||||
{"GetObjectScale", WorldFunctions::GetObjectScale},\
|
{"GetObjectScale", WorldFunctions::GetObjectScale},\
|
||||||
{"GetObjectState", WorldFunctions::GetObjectState},\
|
{"GetObjectDoorState", WorldFunctions::GetObjectDoorState},\
|
||||||
{"GetObjectLockLevel", WorldFunctions::GetObjectLockLevel},\
|
{"GetObjectLockLevel", WorldFunctions::GetObjectLockLevel},\
|
||||||
{"GetObjectPosX", WorldFunctions::GetObjectPosX},\
|
{"GetObjectPosX", WorldFunctions::GetObjectPosX},\
|
||||||
{"GetObjectPosY", WorldFunctions::GetObjectPosY},\
|
{"GetObjectPosY", WorldFunctions::GetObjectPosY},\
|
||||||
|
@ -61,7 +61,7 @@ public:
|
||||||
static void SetObjectCount(int count) noexcept;
|
static void SetObjectCount(int count) noexcept;
|
||||||
static void SetObjectGoldValue(int goldValue) noexcept;
|
static void SetObjectGoldValue(int goldValue) noexcept;
|
||||||
static void SetObjectScale(double scale) 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 SetObjectLockLevel(int lockLevel) noexcept;
|
||||||
static void SetObjectPosition(double x, double y, double z) noexcept;
|
static void SetObjectPosition(double x, double y, double z) noexcept;
|
||||||
static void SetObjectRotation(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 GetObjectCount(unsigned int i) noexcept;
|
||||||
static int GetObjectGoldValue(unsigned int i) noexcept;
|
static int GetObjectGoldValue(unsigned int i) noexcept;
|
||||||
static double GetObjectScale(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 int GetObjectLockLevel(unsigned int i) noexcept;
|
||||||
static double GetObjectPosX(unsigned int i) noexcept;
|
static double GetObjectPosX(unsigned int i) noexcept;
|
||||||
static double GetObjectPosY(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().getRefId().c_str(),
|
||||||
ptrFound.getCellRef().getRefNum());
|
ptrFound.getCellRef().getRefNum());
|
||||||
|
|
||||||
ptrFound.getClass().setDoorState(ptrFound, worldObject.state);
|
ptrFound.getClass().setDoorState(ptrFound, worldObject.doorState);
|
||||||
MWBase::Environment::get().getWorld()->saveDoorState(ptrFound, worldObject.state);
|
MWBase::Environment::get().getWorld()->saveDoorState(ptrFound, worldObject.doorState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2272,7 +2272,7 @@ namespace MWWorld
|
||||||
mwmp::WorldObject worldObject;
|
mwmp::WorldObject worldObject;
|
||||||
worldObject.refId = door.getCellRef().getRefId();
|
worldObject.refId = door.getCellRef().getRefId();
|
||||||
worldObject.refNumIndex = door.getCellRef().getRefNum().mIndex;
|
worldObject.refNumIndex = door.getCellRef().getRefNum().mIndex;
|
||||||
worldObject.state = state;
|
worldObject.doorState = state;
|
||||||
event->addObject(worldObject);
|
event->addObject(worldObject);
|
||||||
|
|
||||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->Send(event);
|
mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->Send(event);
|
||||||
|
@ -2281,7 +2281,7 @@ namespace MWWorld
|
||||||
worldObject.refId.c_str(),
|
worldObject.refId.c_str(),
|
||||||
worldObject.refNumIndex,
|
worldObject.refNumIndex,
|
||||||
event->cell.getDescription().c_str(),
|
event->cell.getDescription().c_str(),
|
||||||
worldObject.state ? "true" : "false");
|
worldObject.doorState ? "true" : "false");
|
||||||
|
|
||||||
delete event;
|
delete event;
|
||||||
event = NULL;
|
event = NULL;
|
||||||
|
@ -2299,7 +2299,7 @@ namespace MWWorld
|
||||||
mwmp::WorldObject worldObject;
|
mwmp::WorldObject worldObject;
|
||||||
worldObject.refId = door.getCellRef().getRefId();
|
worldObject.refId = door.getCellRef().getRefId();
|
||||||
worldObject.refNumIndex = door.getCellRef().getRefNum().mIndex;
|
worldObject.refNumIndex = door.getCellRef().getRefNum().mIndex;
|
||||||
worldObject.state = state;
|
worldObject.doorState = state;
|
||||||
event->addObject(worldObject);
|
event->addObject(worldObject);
|
||||||
|
|
||||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->Send(event);
|
mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->Send(event);
|
||||||
|
@ -2308,7 +2308,7 @@ namespace MWWorld
|
||||||
worldObject.refId.c_str(),
|
worldObject.refId.c_str(),
|
||||||
worldObject.refNumIndex,
|
worldObject.refNumIndex,
|
||||||
event->cell.getDescription().c_str(),
|
event->cell.getDescription().c_str(),
|
||||||
worldObject.state ? "true" : "false");
|
worldObject.doorState ? "true" : "false");
|
||||||
|
|
||||||
delete event;
|
delete event;
|
||||||
event = NULL;
|
event = NULL;
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace mwmp
|
||||||
int goldValue;
|
int goldValue;
|
||||||
ESM::Position pos;
|
ESM::Position pos;
|
||||||
|
|
||||||
int state;
|
int doorState;
|
||||||
int lockLevel;
|
int lockLevel;
|
||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ void PacketDoorState::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send)
|
||||||
|
|
||||||
RW(worldObject.refId, send);
|
RW(worldObject.refId, send);
|
||||||
RW(worldObject.refNumIndex, send);
|
RW(worldObject.refNumIndex, send);
|
||||||
RW(worldObject.state, send);
|
RW(worldObject.doorState, send);
|
||||||
|
|
||||||
if (!send)
|
if (!send)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue