From 0ccbe70e610120cbe56a480beed122ca2438a5c1 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 8 Apr 2017 14:31:22 +0300 Subject: [PATCH] [Client] Rename methods to make their purpose clearer --- apps/openmw/mwmechanics/character.cpp | 22 +++++++++++----------- apps/openmw/mwmp/CellController.cpp | 4 ++-- apps/openmw/mwmp/CellController.hpp | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index b3e5971e3..4b4dbc51f 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1593,15 +1593,15 @@ void CharacterController::update(float duration) Keep track of LocalActor and DedicatedActor objects so as to reuse them */ - bool hasLocalActorRecord = mwmp::Main::get().getCellController()->hasLocalActorRecord(mPtr); - bool hasDedicatedActorRecord = mwmp::Main::get().getCellController()->hasDedicatedActorRecord(mPtr); + bool isLocalActor = mwmp::Main::get().getCellController()->isLocalActor(mPtr); + bool isDedicatedActor = mwmp::Main::get().getCellController()->isDedicatedActor(mPtr); mwmp::LocalActor *localActor = nullptr; mwmp::DedicatedActor *dedicatedActor = nullptr; - if (hasLocalActorRecord) + if (isLocalActor) localActor = mwmp::Main::get().getCellController()->getLocalActor(mPtr); - if (hasDedicatedActorRecord) + if (isDedicatedActor) dedicatedActor = mwmp::Main::get().getCellController()->getDedicatedActor(mPtr); /* End of tes3mp addition @@ -1898,7 +1898,7 @@ void CharacterController::update(float duration) Save or load animation states for this actor, depending on whether it's a local or dedicated one */ - if (hasLocalActorRecord) + if (isLocalActor) { localActor->hasAnimStates = true; localActor->animStates.idlestate = idlestate; @@ -1906,7 +1906,7 @@ void CharacterController::update(float duration) localActor->animStates.jumpstate = jumpstate; localActor->animStates.forcestateupdate = forcestateupdate; } - else if (hasDedicatedActorRecord) + else if (isDedicatedActor) { if (dedicatedActor->hasAnimStates) { @@ -2016,14 +2016,14 @@ void CharacterController::update(float duration) Save or load movement velocity based on whether this is a local or dedicated actor */ - if (hasLocalActorRecord) + if (isLocalActor) { localActor->hasMovement = true; localActor->movement.x = moved.x(); localActor->movement.y = moved.y(); localActor->movement.z = moved.z(); } - else if (hasDedicatedActorRecord) + else if (isDedicatedActor) { if (dedicatedActor->hasMovement) moved = osg::Vec3f(dedicatedActor->movement.x, dedicatedActor->movement.y, dedicatedActor->movement.z); @@ -2166,7 +2166,7 @@ bool CharacterController::playGroup(const std::string &groupname, int mode, int If we are the cell authority over this actor, we need to record this new animation for it */ - if (mwmp::Main::get().getCellController()->hasLocalActorRecord(mPtr)) + if (mwmp::Main::get().getCellController()->isLocalActor(mPtr)) { mwmp::LocalActor *actor = mwmp::Main::get().getCellController()->getLocalActor(mPtr); actor->hasAnimation = true; @@ -2459,13 +2459,13 @@ void CharacterController::updateHeadTracking(float duration) Save or load head pitch and yaw depending on whether this is a local or dedicated actor */ - if (mwmp::Main::get().getCellController()->hasLocalActorRecord(mPtr)) + if (mwmp::Main::get().getCellController()->isLocalActor(mPtr)) { mwmp::LocalActor *localActor = mwmp::Main::get().getCellController()->getLocalActor(mPtr); localActor->headPitch = xAngleRadians; localActor->headYaw = zAngleRadians; } - else if (mwmp::Main::get().getCellController()->hasDedicatedActorRecord(mPtr)) + else if (mwmp::Main::get().getCellController()->isDedicatedActor(mPtr)) { mwmp::DedicatedActor *dedicatedActor = mwmp::Main::get().getCellController()->getDedicatedActor(mPtr); diff --git a/apps/openmw/mwmp/CellController.cpp b/apps/openmw/mwmp/CellController.cpp index c93910571..02fac1916 100644 --- a/apps/openmw/mwmp/CellController.cpp +++ b/apps/openmw/mwmp/CellController.cpp @@ -112,7 +112,7 @@ void CellController::removeLocalActorRecord(std::string actorIndex) localActorsToCells.erase(actorIndex); } -bool CellController::hasLocalActorRecord(MWWorld::Ptr ptr) +bool CellController::isLocalActor(MWWorld::Ptr ptr) { std::string mapIndex = generateMapIndex(ptr); @@ -137,7 +137,7 @@ void CellController::removeDedicatedActorRecord(std::string actorIndex) dedicatedActorsToCells.erase(actorIndex); } -bool CellController::hasDedicatedActorRecord(MWWorld::Ptr ptr) +bool CellController::isDedicatedActor(MWWorld::Ptr ptr) { std::string mapIndex = generateMapIndex(ptr); diff --git a/apps/openmw/mwmp/CellController.hpp b/apps/openmw/mwmp/CellController.hpp index b85e52136..537caf449 100644 --- a/apps/openmw/mwmp/CellController.hpp +++ b/apps/openmw/mwmp/CellController.hpp @@ -25,12 +25,12 @@ namespace mwmp void setLocalActorRecord(std::string actorIndex, std::string cellIndex); void removeLocalActorRecord(std::string actorIndex); - bool hasLocalActorRecord(MWWorld::Ptr ptr); + bool isLocalActor(MWWorld::Ptr ptr); virtual LocalActor *getLocalActor(MWWorld::Ptr ptr); void setDedicatedActorRecord(std::string actorIndex, std::string cellIndex); void removeDedicatedActorRecord(std::string actorIndex); - bool hasDedicatedActorRecord(MWWorld::Ptr ptr); + bool isDedicatedActor(MWWorld::Ptr ptr); virtual DedicatedActor *getDedicatedActor(MWWorld::Ptr ptr); std::string generateMapIndex(MWWorld::Ptr ptr);