[General] Use vector::at in most places

pull/163/head
David Cernat 8 years ago
parent 60d6a6d463
commit 75392297b5

@ -51,7 +51,7 @@ void LocalEvent::editContainer(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
worldObject.refId.c_str(),
@ -100,7 +100,7 @@ void LocalEvent::placeObjects(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s\n- charge: %i\n- count: %i",
worldObject.refId.c_str(),
@ -138,7 +138,7 @@ void LocalEvent::deleteObjects(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
worldObject.refId.c_str(),
@ -164,7 +164,7 @@ void LocalEvent::lockObjects(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
worldObject.refId.c_str(),
@ -190,7 +190,7 @@ void LocalEvent::unlockObjects(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
worldObject.refId.c_str(),
@ -216,7 +216,7 @@ void LocalEvent::scaleObjects(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
worldObject.refId.c_str(),
@ -242,7 +242,7 @@ void LocalEvent::moveObjects(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
worldObject.refId.c_str(),
@ -269,7 +269,7 @@ void LocalEvent::rotateObjects(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
worldObject.refId.c_str(),
@ -296,7 +296,7 @@ void LocalEvent::animateObjects(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
worldObject.refId.c_str(),
@ -323,7 +323,7 @@ void LocalEvent::activateDoors(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
worldObject.refId.c_str(),
@ -350,7 +350,7 @@ void LocalEvent::playMusic()
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- filename: %s",
worldObject.filename.c_str());
@ -365,7 +365,7 @@ void LocalEvent::playVideo()
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- filename: %s\n- allowSkipping: %s",
worldObject.filename.c_str(),
@ -381,7 +381,7 @@ void LocalEvent::setLocalShorts(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s\n- index: %i\n- shortVal: %i",
worldObject.refId.c_str(),
@ -409,7 +409,7 @@ void LocalEvent::setLocalFloats(MWWorld::CellStore* cellStore)
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s\n- index: %i\n- floatVal: %f",
worldObject.refId.c_str(),
@ -437,7 +437,7 @@ void LocalEvent::setMemberShorts()
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s\n- index: %i\n- shortVal: %i\n",
worldObject.refId.c_str(),
@ -469,7 +469,7 @@ void LocalEvent::setGlobalShorts()
for (unsigned int i = 0; i < objectChanges.count; i++)
{
worldObject = objectChanges.objects[i];
worldObject = objectChanges.objects.at(i);
LOG_APPEND(Log::LOG_WARN, "- varName: %s\n- shortVal: %i",
worldObject.varName.c_str(),

@ -636,7 +636,7 @@ void LocalPlayer::addItems()
for (unsigned int i = 0; i < inventoryChanges.count; i++)
{
mwmp::Item item = inventoryChanges.items[i];
mwmp::Item item = inventoryChanges.items.at(i);
MWWorld::Ptr itemPtr = *ptrStore.add(item.refId, item.count, ptrPlayer);
if (item.charge != -1)
itemPtr.getCellRef().setCharge(item.charge);
@ -657,7 +657,7 @@ void LocalPlayer::addJournalItems()
{
for (unsigned int i = 0; i < journalChanges.count; i++)
{
mwmp::JournalItem journalItem = journalChanges.journalItems[i];
mwmp::JournalItem journalItem = journalChanges.journalItems.at(i);
if (journalItem.type == JournalItem::ENTRY)
{
@ -688,7 +688,7 @@ void LocalPlayer::removeItems()
for (unsigned int i = 0; i < inventoryChanges.count; i++)
{
mwmp::Item item = inventoryChanges.items[i];
mwmp::Item item = inventoryChanges.items.at(i);
ptrStore.remove(item.refId, item.count, ptrPlayer);
}
}

@ -26,7 +26,7 @@ void mwmp::PacketPlayerCellState::Packet(RakNet::BitStream *bs, mwmp::BasePlayer
if (send)
{
cellState = player->cellStateChanges.cellStates[i];
cellState = player->cellStateChanges.cellStates.at(i);
}
RW(cellState.type, send);

@ -32,7 +32,7 @@ void PacketPlayerInventory::Packet(RakNet::BitStream *bs, BasePlayer *player, bo
if (send)
{
item = player->inventoryChanges.items[i];
item = player->inventoryChanges.items.at(i);
}
RW(item.refId, send);

@ -25,7 +25,7 @@ void PacketPlayerJournal::Packet(RakNet::BitStream *bs, BasePlayer *player, bool
JournalItem journalItem;
if (send)
journalItem = player->journalChanges.journalItems[i];
journalItem = player->journalChanges.journalItems.at(i);
RW(journalItem.type, send);
RW(journalItem.quest, send);

@ -28,7 +28,7 @@ void PacketPlayerSpellbook::Packet(RakNet::BitStream *bs, BasePlayer *player, bo
if (send)
{
spell = player->spellbookChanges.spells[i];
spell = player->spellbookChanges.spells.at(i);
}
RW(spell.mId, send);

@ -39,7 +39,7 @@ void PacketContainer::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);
@ -57,7 +57,7 @@ void PacketContainer::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send
{
if (send)
{
containerItem = event->containerChanges.items[i];
containerItem = event->containerChanges.items.at(i);
}
RW(containerItem.refId, send);

@ -30,7 +30,7 @@ void PacketDoorState::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -25,7 +25,7 @@ void PacketMusicPlay::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.filename, send);

@ -30,7 +30,7 @@ void PacketObjectAnimPlay::Packet(RakNet::BitStream *bs, WorldEvent *event, bool
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -30,7 +30,7 @@ void PacketObjectDelete::Packet(RakNet::BitStream *bs, WorldEvent *event, bool s
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -30,7 +30,7 @@ void PacketObjectLock::Packet(RakNet::BitStream *bs, WorldEvent *event, bool sen
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -30,7 +30,7 @@ void PacketObjectMove::Packet(RakNet::BitStream *bs, WorldEvent *event, bool sen
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -30,7 +30,7 @@ void PacketObjectPlace::Packet(RakNet::BitStream *bs, WorldEvent *event, bool se
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -30,7 +30,7 @@ void PacketObjectRotate::Packet(RakNet::BitStream *bs, WorldEvent *event, bool s
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -30,7 +30,7 @@ void PacketObjectScale::Packet(RakNet::BitStream *bs, WorldEvent *event, bool se
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -30,7 +30,7 @@ void PacketObjectUnlock::Packet(RakNet::BitStream *bs, WorldEvent *event, bool s
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -25,7 +25,7 @@ void PacketScriptGlobalShort::Packet(RakNet::BitStream *bs, WorldEvent *event, b
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.varName, send);

@ -30,7 +30,7 @@ void PacketScriptLocalFloat::Packet(RakNet::BitStream *bs, WorldEvent *event, bo
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -30,7 +30,7 @@ void PacketScriptLocalShort::Packet(RakNet::BitStream *bs, WorldEvent *event, bo
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -25,7 +25,7 @@ void PacketScriptMemberShort::Packet(RakNet::BitStream *bs, WorldEvent *event, b
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.refId, send);

@ -25,7 +25,7 @@ void PacketVideoPlay::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send
{
if (send)
{
worldObject = event->objectChanges.objects[i];
worldObject = event->objectChanges.objects.at(i);
}
RW(worldObject.filename, send);

Loading…
Cancel
Save