diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index d8f5e57a0..97c193a57 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -551,7 +551,7 @@ namespace MWClass void Npc::hit(const MWWorld::Ptr& ptr, float attackStrength, int type) const { - if(mwmp::Main::get().getNetworking()->isDedicatedPlayer(ptr)) + if (mwmp::Main::get().getNetworking()->isDedicatedPlayer(ptr)) return; MWBase::World *world = MWBase::Environment::get().getWorld(); @@ -594,16 +594,16 @@ namespace MWClass float hitchance = MWMechanics::getHitChance(ptr, victim, ptr.getClass().getSkill(ptr, weapskill)); - if(ptr == MWBase::Environment::get().getWorld()->getPlayerPtr()) + if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr()) { mwmp::Main::get().getLocalPlayer()->GetAttack()->success = true; - if(mwmp::Main::get().getNetworking()->isDedicatedPlayer(victim)) + if (mwmp::Main::get().getNetworking()->isDedicatedPlayer(victim)) mwmp::Main::get().getLocalPlayer()->GetAttack()->target =mwmp::Players::GetPlayer(victim)->guid; } if(Misc::Rng::roll0to99() >= hitchance) { - if(ptr == MWBase::Environment::get().getWorld()->getPlayerPtr()) + if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr()) { mwmp::Main::get().getLocalPlayer()->GetAttack()->success = false; mwmp::Main::get().getLocalPlayer()->sendAttack(0); @@ -843,7 +843,7 @@ namespace MWClass } - if(attacker == MWMechanics::getPlayer() && mwmp::Main::get().getNetworking()->isDedicatedPlayer(ptr)) + if (attacker == MWMechanics::getPlayer() && mwmp::Main::get().getNetworking()->isDedicatedPlayer(ptr)) { mwmp::Attack *_atk = mwmp::Main::get().getLocalPlayer()->GetAttack(); _atk->damage = damage; @@ -853,7 +853,7 @@ namespace MWClass mwmp::Main::get().getLocalPlayer()->sendAttack(0); // todo: make this sensitive to different weapon types } - if(ptr == MWMechanics::getPlayer()) + if (ptr == MWMechanics::getPlayer()) { mwmp::Main::get().getLocalPlayer()->updateDynamicStats(true); mwmp::Main::get().getLocalPlayer()->updatePosition(true); // fix position after getting damage; @@ -863,7 +863,7 @@ namespace MWClass boost::shared_ptr Npc::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { - if(actor == MWMechanics::getPlayer() && mwmp::Main::get().getNetworking()->isDedicatedPlayer(ptr)) + if (actor == MWMechanics::getPlayer() && mwmp::Main::get().getNetworking()->isDedicatedPlayer(ptr)) return boost::shared_ptr(new MWWorld::FailedAction("Not implemented.")); // player got activated by another NPC if(ptr == MWMechanics::getPlayer()) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 5b6e762a0..5eb9adf87 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1039,7 +1039,7 @@ namespace MWMechanics mwmp::Main::get().getLocalPlayer()->prepareAttack(2, state); } - if(mwmp::Main::get().getNetworking()->isDedicatedPlayer(iter->first)) + if (mwmp::Main::get().getNetworking()->isDedicatedPlayer(iter->first)) iter->second->getCharacterController()->setAttackingOrSpell(mwmp::Main::get().getNetworking()->Attack(iter->first)); diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index 9a3282f47..ddc4af4cb 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -117,13 +117,13 @@ namespace MWMechanics bool isDedicated = mwmp::Main::get().getNetworking()->isDedicatedPlayer(blocker); - if(attacker == MWMechanics::getPlayer()) + if (attacker == MWMechanics::getPlayer()) mwmp::Main::get().getLocalPlayer()->GetAttack()->block = false; - if((!isDedicated && Misc::Rng::roll0to99() < x) || + if ((!isDedicated && Misc::Rng::roll0to99() < x) || (isDedicated && mwmp::Players::GetPlayer(blocker)->GetAttack()->block == 1)) { - if(attacker == MWMechanics::getPlayer()) + if (attacker == MWMechanics::getPlayer()) mwmp::Main::get().getLocalPlayer()->GetAttack()->block = true; // Reduce shield durability by incoming damage @@ -180,7 +180,7 @@ namespace MWMechanics void projectileHit(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim, MWWorld::Ptr weapon, const MWWorld::Ptr &projectile, const osg::Vec3f& hitPosition, float attackStrength) { - if(mwmp::Main::get().getNetworking()->isDedicatedPlayer(attacker)) + if (mwmp::Main::get().getNetworking()->isDedicatedPlayer(attacker)) return; MWBase::World *world = MWBase::Environment::get().getWorld(); const MWWorld::Store &gmst = world->getStore().get(); @@ -202,7 +202,7 @@ namespace MWMechanics int skillValue = attacker.getClass().getSkill(attacker, weapon.getClass().getEquipmentSkill(weapon)); - if(attacker == MWBase::Environment::get().getWorld()->getPlayerPtr()) + if (attacker == MWBase::Environment::get().getWorld()->getPlayerPtr()) mwmp::Main::get().getLocalPlayer()->GetAttack()->success = true; if (Misc::Rng::roll0to99() >= getHitChance(attacker, victim, skillValue)) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 9aee1d00f..a5c4176eb 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -799,13 +799,13 @@ namespace MWMechanics bool isDedicated = mwmp::Main::get().getNetworking()->isDedicatedPlayer(mCaster); - if(mCaster == getPlayer()) + if (mCaster == getPlayer()) { mwmp::Main::get().getLocalPlayer()->GetAttack()->success = true; mwmp::Main::get().getLocalPlayer()->GetAttack()->pressed = true; } - if(isDedicated) + if (isDedicated) { mwmp::Players::GetPlayer(mCaster)->GetAttack()->pressed = false; } @@ -821,7 +821,7 @@ namespace MWMechanics fail = true; } - if(mCaster == getPlayer()) + if (mCaster == getPlayer()) { mwmp::Main::get().getLocalPlayer()->sendAttack(1); mwmp::Main::get().getLocalPlayer()->GetAttack()->pressed = false;