forked from mirror/openmw-tes3mp
Fix formatting
This commit is contained in:
parent
f562215d9a
commit
a20e7890a2
4 changed files with 14 additions and 14 deletions
|
@ -42,7 +42,7 @@ void CharClassFunctions::SetClassMajorAttribute(unsigned short pid, unsigned cha
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player,);
|
GET_PLAYER(pid, player,);
|
||||||
|
|
||||||
if(slot > 1)
|
if (slot > 1)
|
||||||
throw invalid_argument("Incorrect attribute slot id");
|
throw invalid_argument("Incorrect attribute slot id");
|
||||||
|
|
||||||
player->klass.mData.mAttribute[slot] = attrId;
|
player->klass.mData.mAttribute[slot] = attrId;
|
||||||
|
@ -58,7 +58,7 @@ void CharClassFunctions::SetClassMajorSkill(unsigned short pid, unsigned char sl
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player,);
|
GET_PLAYER(pid, player,);
|
||||||
if(slot > 4)
|
if (slot > 4)
|
||||||
throw invalid_argument("Incorrect skill slot id");
|
throw invalid_argument("Incorrect skill slot id");
|
||||||
player->klass.mData.mSkills[slot][1] = skillId;
|
player->klass.mData.mSkills[slot][1] = skillId;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ void CharClassFunctions::SetClassMinorSkill(unsigned short pid, unsigned char sl
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player,);
|
GET_PLAYER(pid, player,);
|
||||||
if(slot > 4)
|
if (slot > 4)
|
||||||
throw invalid_argument("Incorrect skill slot id");
|
throw invalid_argument("Incorrect skill slot id");
|
||||||
player->klass.mData.mSkills[slot][0] = skillId;
|
player->klass.mData.mSkills[slot][0] = skillId;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ int CharClassFunctions::GetClassMajorAttribute(unsigned short pid, unsigned char
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player,0);
|
GET_PLAYER(pid, player,0);
|
||||||
if(slot > 1)
|
if (slot > 1)
|
||||||
throw invalid_argument("Incorrect attribute slot id");
|
throw invalid_argument("Incorrect attribute slot id");
|
||||||
return player->klass.mData.mAttribute[slot];
|
return player->klass.mData.mAttribute[slot];
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ int CharClassFunctions::GetClassMajorSkill(unsigned short pid, unsigned char slo
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player,0);
|
GET_PLAYER(pid, player,0);
|
||||||
if(slot > 4)
|
if (slot > 4)
|
||||||
throw invalid_argument("Incorrect skill slot id");
|
throw invalid_argument("Incorrect skill slot id");
|
||||||
return player->klass.mData.mSkills[slot][1];
|
return player->klass.mData.mSkills[slot][1];
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ int CharClassFunctions::GetClassMinorSkill(unsigned short pid, unsigned char slo
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player,0);
|
GET_PLAYER(pid, player,0);
|
||||||
if(slot > 4)
|
if (slot > 4)
|
||||||
throw invalid_argument("Incorrect skill slot id");
|
throw invalid_argument("Incorrect skill slot id");
|
||||||
return player->klass.mData.mSkills[slot][0];
|
return player->klass.mData.mSkills[slot][0];
|
||||||
}
|
}
|
||||||
|
|
|
@ -586,7 +586,7 @@ void LocalPlayer::updateChar()
|
||||||
|
|
||||||
void LocalPlayer::SetClass()
|
void LocalPlayer::SetClass()
|
||||||
{
|
{
|
||||||
if(klass.mId.empty()) // custom class
|
if (klass.mId.empty()) // custom class
|
||||||
{
|
{
|
||||||
klass.mData.mIsPlayable = 0x1;
|
klass.mData.mIsPlayable = 0x1;
|
||||||
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(klass);
|
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(klass);
|
||||||
|
@ -607,7 +607,7 @@ void LocalPlayer::SendClass()
|
||||||
const ESM::NPC *cpl = world->getPlayerPtr().get<ESM::NPC>()->mBase;
|
const ESM::NPC *cpl = world->getPlayerPtr().get<ESM::NPC>()->mBase;
|
||||||
const ESM::Class *cls = world->getStore().get<ESM::Class>().find(cpl->mClass);
|
const ESM::Class *cls = world->getStore().get<ESM::Class>().find(cpl->mClass);
|
||||||
|
|
||||||
if(cpl->mClass.find("$dynamic") != string::npos) // custom class
|
if (cpl->mClass.find("$dynamic") != string::npos) // custom class
|
||||||
{
|
{
|
||||||
klass.mId = "";
|
klass.mId = "";
|
||||||
klass.mName = cls->mName;
|
klass.mName = cls->mName;
|
||||||
|
|
|
@ -577,7 +577,7 @@ void Networking::ReceiveMessage(RakNet::Packet *packet)
|
||||||
{
|
{
|
||||||
if (id == myid)
|
if (id == myid)
|
||||||
{
|
{
|
||||||
if(packet->length == myPacket->headerSize())
|
if (packet->length == myPacket->headerSize())
|
||||||
getLocalPlayer()->SendClass();
|
getLocalPlayer()->SendClass();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -589,15 +589,15 @@ void Networking::ReceiveMessage(RakNet::Packet *packet)
|
||||||
}
|
}
|
||||||
case ID_GAME_TIME:
|
case ID_GAME_TIME:
|
||||||
{
|
{
|
||||||
if(id == myid)
|
if (id == myid)
|
||||||
{
|
{
|
||||||
myPacket->Packet(&bsIn, getLocalPlayer(), false);
|
myPacket->Packet(&bsIn, getLocalPlayer(), false);
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
if(getLocalPlayer()->hour != -1)
|
if (getLocalPlayer()->hour != -1)
|
||||||
world->setHour(getLocalPlayer()->hour);
|
world->setHour(getLocalPlayer()->hour);
|
||||||
else if(getLocalPlayer()->day != -1)
|
else if (getLocalPlayer()->day != -1)
|
||||||
world->setDay(getLocalPlayer()->day);
|
world->setDay(getLocalPlayer()->day);
|
||||||
else if(getLocalPlayer()->month != -1)
|
else if (getLocalPlayer()->month != -1)
|
||||||
world->setMonth(getLocalPlayer()->month);
|
world->setMonth(getLocalPlayer()->month);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ void mwmp::PacketClass::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player,
|
||||||
BasePacket::Packet(bs, player, send);
|
BasePacket::Packet(bs, player, send);
|
||||||
|
|
||||||
RW(player->klass.mId, send);
|
RW(player->klass.mId, send);
|
||||||
if(player->klass.mId.empty()) // custom class
|
if (player->klass.mId.empty()) // custom class
|
||||||
{
|
{
|
||||||
RW(player->klass.mName, send);
|
RW(player->klass.mName, send);
|
||||||
RW(player->klass.mDescription, send);
|
RW(player->klass.mDescription, send);
|
||||||
|
|
Loading…
Reference in a new issue