From 50383537928321a88becb0ffe4000cfaade2a4ce Mon Sep 17 00:00:00 2001 From: David Cernat Date: Mon, 6 Feb 2017 23:09:50 +0200 Subject: [PATCH] [General] Rename BaseEvent's state into doorState & adjust related funcs --- apps/openmw-mp/Script/Functions/World.cpp | 10 +++++----- apps/openmw-mp/Script/Functions/World.hpp | 8 ++++---- apps/openmw/mwmp/WorldEvent.cpp | 4 ++-- apps/openmw/mwworld/worldimp.cpp | 8 ++++---- components/openmw-mp/Base/BaseEvent.hpp | 2 +- components/openmw-mp/Packets/World/PacketDoorState.cpp | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/openmw-mp/Script/Functions/World.cpp b/apps/openmw-mp/Script/Functions/World.cpp index aa153714a..656c1bef3 100644 --- a/apps/openmw-mp/Script/Functions/World.cpp +++ b/apps/openmw-mp/Script/Functions/World.cpp @@ -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 diff --git a/apps/openmw-mp/Script/Functions/World.hpp b/apps/openmw-mp/Script/Functions/World.hpp index a32f81bf2..e28dd3de0 100644 --- a/apps/openmw-mp/Script/Functions/World.hpp +++ b/apps/openmw-mp/Script/Functions/World.hpp @@ -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; diff --git a/apps/openmw/mwmp/WorldEvent.cpp b/apps/openmw/mwmp/WorldEvent.cpp index b40e56708..e895fed06 100644 --- a/apps/openmw/mwmp/WorldEvent.cpp +++ b/apps/openmw/mwmp/WorldEvent.cpp @@ -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); } } } diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 1941f3ac0..c8e664791 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -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; diff --git a/components/openmw-mp/Base/BaseEvent.hpp b/components/openmw-mp/Base/BaseEvent.hpp index 49ea46b4f..8a806b165 100644 --- a/components/openmw-mp/Base/BaseEvent.hpp +++ b/components/openmw-mp/Base/BaseEvent.hpp @@ -16,7 +16,7 @@ namespace mwmp int goldValue; ESM::Position pos; - int state; + int doorState; int lockLevel; float scale; diff --git a/components/openmw-mp/Packets/World/PacketDoorState.cpp b/components/openmw-mp/Packets/World/PacketDoorState.cpp index c14659958..0df9cdcad 100644 --- a/components/openmw-mp/Packets/World/PacketDoorState.cpp +++ b/components/openmw-mp/Packets/World/PacketDoorState.cpp @@ -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) {