mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 10:23:52 +00:00
Fix formatting in previous changes made by tes3mp to OpenMW's core
This commit is contained in:
parent
d0328f2553
commit
e27d1857ef
4 changed files with 16 additions and 16 deletions
|
@ -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<MWWorld::Action> 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<MWWorld::Action>(new MWWorld::FailedAction("Not implemented."));
|
||||
// player got activated by another NPC
|
||||
if(ptr == MWMechanics::getPlayer())
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
||||
|
|
|
@ -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<ESM::GameSetting> &gmst = world->getStore().get<ESM::GameSetting>();
|
||||
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue