1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-28 15:09:40 +00:00

Merge pull request #2375 from akortunov/warnfix

Do not copy pointers during iteration
This commit is contained in:
Alexei Dobrohotov 2019-05-11 14:10:01 +03:00 committed by GitHub
commit 0cea76c684
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -470,7 +470,7 @@ namespace MWMechanics
{ {
MWBase::Environment::get().getMechanicsManager()->startCombat(actor1, actor2); MWBase::Environment::get().getMechanicsManager()->startCombat(actor1, actor2);
// Also have actor1's allies start combat // Also have actor1's allies start combat
for (const MWWorld::Ptr ally1 : allies1) for (const MWWorld::Ptr& ally1 : allies1)
MWBase::Environment::get().getMechanicsManager()->startCombat(ally1, actor2); MWBase::Environment::get().getMechanicsManager()->startCombat(ally1, actor2);
return; return;
} }
@ -2075,7 +2075,7 @@ namespace MWMechanics
std::vector<MWWorld::Ptr> neighbors; std::vector<MWWorld::Ptr> neighbors;
osg::Vec3f position (actor.getRefData().getPosition().asVec3()); osg::Vec3f position (actor.getRefData().getPosition().asVec3());
getObjectsInRange(position, mActorsProcessingRange, neighbors); getObjectsInRange(position, mActorsProcessingRange, neighbors);
for(const MWWorld::Ptr neighbor : neighbors) for(const MWWorld::Ptr& neighbor : neighbors)
{ {
if (neighbor == actor) if (neighbor == actor)
continue; continue;