forked from teamnwah/openmw-tes3coop
[General] Fix clang-tidy warning
Converting integer literal to bool, use bool literal instead
This commit is contained in:
parent
7639db02f3
commit
23684489da
27 changed files with 70 additions and 70 deletions
|
@ -51,8 +51,8 @@ bool ActorPacket::PacketHeader(RakNet::BitStream *bs, bool send)
|
|||
{
|
||||
BasePacket::Packet(bs, send);
|
||||
|
||||
RW(actorList->cell.mData, send, 1);
|
||||
RW(actorList->cell.mName, send, 1);
|
||||
RW(actorList->cell.mData, send, true);
|
||||
RW(actorList->cell.mName, send, true);
|
||||
|
||||
if (send)
|
||||
actorList->count = (unsigned int)(actorList->baseActors.size());
|
||||
|
|
|
@ -24,7 +24,7 @@ void PacketActorAI::Actor(BaseActor &actor, bool send)
|
|||
}
|
||||
else
|
||||
{
|
||||
RW(actor.aiTarget.refId, send, 1);
|
||||
RW(actor.aiTarget.refId, send, true);
|
||||
RW(actor.aiTarget.refNumIndex, send);
|
||||
RW(actor.aiTarget.mpNum, send);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ void PacketActorAttack::Actor(BaseActor &actor, bool send)
|
|||
}
|
||||
else
|
||||
{
|
||||
RW(actor.attack.target.refId, send, 1);
|
||||
RW(actor.attack.target.refId, send, true);
|
||||
RW(actor.attack.target.refNumIndex, send);
|
||||
RW(actor.attack.target.mpNum, send);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@ void PacketActorAuthority::Packet(RakNet::BitStream *bs, bool send)
|
|||
{
|
||||
BasePacket::Packet(bs, send);
|
||||
|
||||
RW(actorList->cell.mData, send, 1);
|
||||
RW(actorList->cell.mName, send, 1);
|
||||
RW(actorList->cell.mData, send, true);
|
||||
RW(actorList->cell.mName, send, true);
|
||||
}
|
||||
|
|
|
@ -11,9 +11,9 @@ PacketActorCellChange::PacketActorCellChange(RakNet::RakPeerInterface *peer) : A
|
|||
|
||||
void PacketActorCellChange::Actor(BaseActor &actor, bool send)
|
||||
{
|
||||
RW(actor.cell.mData, send, 1);
|
||||
RW(actor.cell.mName, send, 1);
|
||||
RW(actor.cell.mData, send, true);
|
||||
RW(actor.cell.mName, send, true);
|
||||
|
||||
RW(actor.position, send, 1);
|
||||
RW(actor.direction, send, 1);
|
||||
RW(actor.position, send, true);
|
||||
RW(actor.direction, send, true);
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ PacketActorPosition::PacketActorPosition(RakNet::RakPeerInterface *peer) : Actor
|
|||
|
||||
void PacketActorPosition::Actor(BaseActor &actor, bool send)
|
||||
{
|
||||
RW(actor.position, send, 1);
|
||||
RW(actor.direction, send, 1);
|
||||
RW(actor.position, send, true);
|
||||
RW(actor.direction, send, true);
|
||||
|
||||
actor.hasPositionData = true;
|
||||
}
|
||||
|
|
|
@ -63,8 +63,8 @@ bool ObjectPacket::PacketHeader(RakNet::BitStream *bs, bool send)
|
|||
|
||||
if (hasCellData)
|
||||
{
|
||||
RW(objectList->cell.mData, send, 1);
|
||||
RW(objectList->cell.mName, send, 1);
|
||||
RW(objectList->cell.mData, send, true);
|
||||
RW(objectList->cell.mName, send, true);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -17,11 +17,11 @@ void PacketDoorDestination::Object(BaseObject &baseObject, bool send)
|
|||
|
||||
if (baseObject.teleportState)
|
||||
{
|
||||
RW(baseObject.destinationCell.mData, send, 1);
|
||||
RW(baseObject.destinationCell.mName, send, 1);
|
||||
RW(baseObject.destinationCell.mData, send, true);
|
||||
RW(baseObject.destinationCell.mName, send, true);
|
||||
|
||||
RW(baseObject.destinationPosition.pos, send, 1);
|
||||
RW(baseObject.destinationPosition.rot[0], send, 1);
|
||||
RW(baseObject.destinationPosition.rot[2], send, 1);
|
||||
RW(baseObject.destinationPosition.pos, send, true);
|
||||
RW(baseObject.destinationPosition.rot[0], send, true);
|
||||
RW(baseObject.destinationPosition.rot[2], send, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ void PacketObjectSpawn::Object(BaseObject &baseObject, bool send)
|
|||
}
|
||||
else
|
||||
{
|
||||
RW(baseObject.master.refId, send, 1);
|
||||
RW(baseObject.master.refId, send, true);
|
||||
RW(baseObject.master.refNumIndex, send);
|
||||
RW(baseObject.master.mpNum, send);
|
||||
}
|
||||
|
|
|
@ -24,15 +24,15 @@ void PacketPlayerAttack::Packet(RakNet::BitStream *bs, bool send)
|
|||
}
|
||||
else
|
||||
{
|
||||
RW(player->attack.target.refId, send, 1);
|
||||
RW(player->attack.target.refId, send, true);
|
||||
RW(player->attack.target.refNumIndex, send);
|
||||
RW(player->attack.target.mpNum, send);
|
||||
}
|
||||
|
||||
RW(player->attack.spellId, send, 1);
|
||||
RW(player->attack.spellId, send, true);
|
||||
RW(player->attack.type, send);
|
||||
RW(player->attack.success, send);
|
||||
RW(player->attack.damage, send, 0); // never compress damage
|
||||
RW(player->attack.damage, send, false); // never compress damage
|
||||
|
||||
RW(player->attack.pressed, send);
|
||||
RW(player->attack.knockdown, send);
|
||||
|
|
|
@ -16,15 +16,15 @@ void PacketPlayerBaseInfo::Packet(RakNet::BitStream *bs, bool send)
|
|||
{
|
||||
PlayerPacket::Packet(bs, send);
|
||||
|
||||
RW(player->npc.mName, send, 1);
|
||||
RW(player->npc.mModel, send, 1);
|
||||
RW(player->npc.mRace, send, 1);
|
||||
RW(player->npc.mHair, send, 1);
|
||||
RW(player->npc.mHead, send, 1);
|
||||
RW(player->npc.mName, send, true);
|
||||
RW(player->npc.mModel, send, true);
|
||||
RW(player->npc.mRace, send, true);
|
||||
RW(player->npc.mHair, send, true);
|
||||
RW(player->npc.mHead, send, true);
|
||||
|
||||
RW(player->npc.mFlags, send);
|
||||
|
||||
RW(player->birthsign, send, 1);
|
||||
RW(player->birthsign, send, true);
|
||||
|
||||
RW(player->resetStats, send);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ void PacketPlayerBook::Packet(RakNet::BitStream *bs, bool send)
|
|||
if (send)
|
||||
book = player->bookChanges.books.at(i);
|
||||
|
||||
RW(book.bookId, send, 1);
|
||||
RW(book.bookId, send, true);
|
||||
|
||||
if (!send)
|
||||
player->bookChanges.books.push_back(book);
|
||||
|
|
|
@ -17,13 +17,13 @@ void mwmp::PacketPlayerCellChange::Packet(RakNet::BitStream *bs, bool send)
|
|||
{
|
||||
PlayerPacket::Packet(bs, send);
|
||||
|
||||
RW(player->cell.mData, send, 1);
|
||||
RW(player->cell.mName, send, 1);
|
||||
RW(player->cell.mData, send, true);
|
||||
RW(player->cell.mName, send, true);
|
||||
|
||||
RW(player->previousCellPosition.pos, send, 1);
|
||||
RW(player->previousCellPosition.pos, send, true);
|
||||
|
||||
RW(player->isChangingRegion, send);
|
||||
|
||||
if (player->isChangingRegion)
|
||||
RW(player->cell.mRegion, send, 1);
|
||||
RW(player->cell.mRegion, send, true);
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ void mwmp::PacketPlayerCellState::Packet(RakNet::BitStream *bs, bool send)
|
|||
cellState = player->cellStateChanges.cellStates.at(i);
|
||||
|
||||
RW(cellState.type, send);
|
||||
RW(cellState.cell.mData, send, 1);
|
||||
RW(cellState.cell.mName, send, 1);
|
||||
RW(cellState.cell.mData, send, true);
|
||||
RW(cellState.cell.mName, send, true);
|
||||
|
||||
if (!send)
|
||||
player->cellStateChanges.cellStates.push_back(cellState);
|
||||
|
|
|
@ -18,8 +18,8 @@ void mwmp::PacketPlayerClass::Packet(RakNet::BitStream *bs, bool send)
|
|||
|
||||
if (player->charClass.mId.empty()) // custom class
|
||||
{
|
||||
RW(player->charClass.mName, send, 1);
|
||||
RW(player->charClass.mDescription, send, 1);
|
||||
RW(player->charClass.mData, send, 1);
|
||||
RW(player->charClass.mName, send, true);
|
||||
RW(player->charClass.mDescription, send, true);
|
||||
RW(player->charClass.mData, send, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace mwmp
|
|||
{
|
||||
PlayerPacket::Packet(bs, send);
|
||||
|
||||
RW(player->deathReason, send, 1);
|
||||
RW(player->deathReason, send, true);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ void PacketPlayerFaction::Packet(RakNet::BitStream *bs, bool send)
|
|||
if (send)
|
||||
faction = player->factionChanges.factions.at(i);
|
||||
|
||||
RW(faction.factionId, send, 1);
|
||||
RW(faction.factionId, send, true);
|
||||
|
||||
if (player->factionChanges.action == FactionChanges::RANK)
|
||||
RW(faction.rank, send);
|
||||
|
|
|
@ -33,7 +33,7 @@ void PacketPlayerInventory::Packet(RakNet::BitStream *bs, bool send)
|
|||
if (send)
|
||||
item = player->inventoryChanges.items.at(i);
|
||||
|
||||
RW(item.refId, send, 1);
|
||||
RW(item.refId, send, true);
|
||||
RW(item.count, send);
|
||||
RW(item.charge, send);
|
||||
RW(item.enchantmentCharge, send);
|
||||
|
|
|
@ -16,6 +16,6 @@ void PacketPlayerJail::Packet(RakNet::BitStream *bs, bool send)
|
|||
RW(player->jailDays, send);
|
||||
RW(player->ignoreJailTeleportation, send);
|
||||
RW(player->ignoreJailSkillIncreases, send);
|
||||
RW(player->jailProgressText, send, 1);
|
||||
RW(player->jailEndText, send, 1);
|
||||
RW(player->jailProgressText, send, true);
|
||||
RW(player->jailEndText, send, true);
|
||||
}
|
||||
|
|
|
@ -28,12 +28,12 @@ void PacketPlayerJournal::Packet(RakNet::BitStream *bs, bool send)
|
|||
journalItem = player->journalChanges.journalItems.at(i);
|
||||
|
||||
RW(journalItem.type, send);
|
||||
RW(journalItem.quest, send, 1);
|
||||
RW(journalItem.quest, send, true);
|
||||
RW(journalItem.index, send);
|
||||
|
||||
if (journalItem.type == JournalItem::ENTRY)
|
||||
{
|
||||
RW(journalItem.actorRefId, send, 1);
|
||||
RW(journalItem.actorRefId, send, true);
|
||||
}
|
||||
|
||||
if (!send)
|
||||
|
|
|
@ -24,7 +24,7 @@ void mwmp::PacketPlayerKillCount::Packet(RakNet::BitStream *bs, bool send)
|
|||
if (send)
|
||||
kill = player->killChanges.kills.at(i);
|
||||
|
||||
RW(kill.refId, send, 1);
|
||||
RW(kill.refId, send, true);
|
||||
RW(kill.number, send);
|
||||
|
||||
if (!send)
|
||||
|
|
|
@ -16,13 +16,13 @@ void PacketPlayerMiscellaneous::Packet(RakNet::BitStream *bs, bool send)
|
|||
|
||||
if (player->miscellaneousChangeType == mwmp::MISCELLANEOUS_CHANGE_TYPE::MARK_LOCATION)
|
||||
{
|
||||
RW(player->markCell.mData, send, 1);
|
||||
RW(player->markCell.mName, send, 1);
|
||||
RW(player->markCell.mData, send, true);
|
||||
RW(player->markCell.mName, send, true);
|
||||
|
||||
RW(player->markPosition.pos, send);
|
||||
RW(player->markPosition.rot[0], send);
|
||||
RW(player->markPosition.rot[2], send);
|
||||
}
|
||||
else if (player->miscellaneousChangeType == mwmp::MISCELLANEOUS_CHANGE_TYPE::SELECTED_SPELL)
|
||||
RW(player->selectedSpellId, send, 1);
|
||||
RW(player->selectedSpellId, send, true);
|
||||
}
|
||||
|
|
|
@ -13,5 +13,5 @@ void PacketPlayerMomentum::Packet(RakNet::BitStream *bs, bool send)
|
|||
{
|
||||
PlayerPacket::Packet(bs, send);
|
||||
|
||||
RW(player->momentum.pos, send, 1);
|
||||
RW(player->momentum.pos, send, true);
|
||||
}
|
||||
|
|
|
@ -29,10 +29,10 @@ void PacketPlayerPosition::Packet(RakNet::BitStream *bs, bool send)
|
|||
dir = (player->direction.pos[0] >= 0 ? (unsigned char)(player->direction.pos[0]) : (unsigned char) 0x3) << 2; // pack direction
|
||||
dir += (player->direction.pos[1] >= 0 ? (unsigned char)(player->direction.pos[1]) : (unsigned char) 0x3);
|
||||
}
|
||||
RW(rot[0], send, 1);
|
||||
RW(rot[1], send, 1);
|
||||
RW(rot[0], send, true);
|
||||
RW(rot[1], send, true);
|
||||
|
||||
RW(player->position.pos, send, 1);
|
||||
RW(player->position.pos, send, true);
|
||||
RW(dir, send);
|
||||
|
||||
if (!send)
|
||||
|
|
|
@ -16,5 +16,5 @@ void PacketPlayerShapeshift::Packet(RakNet::BitStream *bs, bool send)
|
|||
RW(player->isWerewolf, send);
|
||||
|
||||
RW(player->displayCreatureName, send);
|
||||
RW(player->creatureRefId, send, 1);
|
||||
RW(player->creatureRefId, send, true);
|
||||
}
|
||||
|
|
|
@ -29,21 +29,21 @@ void PacketPlayerSpellbook::Packet(RakNet::BitStream *bs, bool send)
|
|||
if (send)
|
||||
spell = player->spellbookChanges.spells.at(i);
|
||||
|
||||
RW(spell.mId, send, 1);
|
||||
RW(spell.mId, send, true);
|
||||
|
||||
if(spell.mId.find("$dynamic") != string::npos)
|
||||
{
|
||||
RW(spell.mName, send, 1);
|
||||
RW(spell.mName, send, true);
|
||||
|
||||
RW(spell.mData.mType, send, 1);
|
||||
RW(spell.mData.mCost, send, 1);
|
||||
RW(spell.mData.mFlags, send, 1);
|
||||
RW(spell.mData.mType, send, true);
|
||||
RW(spell.mData.mCost, send, true);
|
||||
RW(spell.mData.mFlags, send, true);
|
||||
|
||||
int effectCount = 0;
|
||||
if (send)
|
||||
effectCount = spell.mEffects.mList.size();
|
||||
|
||||
RW(effectCount, send, 1);
|
||||
RW(effectCount, send, true);
|
||||
|
||||
for (unsigned int j = 0; j < effectCount; j++)
|
||||
{
|
||||
|
@ -51,14 +51,14 @@ void PacketPlayerSpellbook::Packet(RakNet::BitStream *bs, bool send)
|
|||
if (send)
|
||||
effect = spell.mEffects.mList.at(j);
|
||||
|
||||
RW(effect.mEffectID, send, 1);
|
||||
RW(effect.mSkill, send, 1);
|
||||
RW(effect.mAttribute, send, 1);
|
||||
RW(effect.mRange, send, 1);
|
||||
RW(effect.mArea, send, 1);
|
||||
RW(effect.mDuration, send, 1);
|
||||
RW(effect.mMagnMin, send, 1);
|
||||
RW(effect.mMagnMax, send, 1);
|
||||
RW(effect.mEffectID, send, true);
|
||||
RW(effect.mSkill, send, true);
|
||||
RW(effect.mAttribute, send, true);
|
||||
RW(effect.mRange, send, true);
|
||||
RW(effect.mArea, send, true);
|
||||
RW(effect.mDuration, send, true);
|
||||
RW(effect.mMagnMin, send, true);
|
||||
RW(effect.mMagnMax, send, true);
|
||||
|
||||
if(!send)
|
||||
spell.mEffects.mList.push_back(effect);
|
||||
|
|
|
@ -27,7 +27,7 @@ void PacketPlayerTopic::Packet(RakNet::BitStream *bs, bool send)
|
|||
if (send)
|
||||
topic = player->topicChanges.topics.at(i);
|
||||
|
||||
RW(topic.topicId, send, 1);
|
||||
RW(topic.topicId, send, true);
|
||||
|
||||
if (!send)
|
||||
player->topicChanges.topics.push_back(topic);
|
||||
|
|
Loading…
Reference in a new issue