Clamp price multiplication to 1, as it resulted in player alone traveling at no fee.

coverity_scan^2
NeveHanter 8 years ago
parent 8902bb5b13
commit 15cd3c178b

@ -78,7 +78,7 @@ namespace MWGui
std::set<MWWorld::Ptr> followers; std::set<MWWorld::Ptr> followers;
MWBase::Environment::get().getMechanicsManager()->getActorsFollowing(player, followers); MWBase::Environment::get().getMechanicsManager()->getActorsFollowing(player, followers);
unsigned int travellingFollowers = 0; int travellingFollowers = 0;
for(std::set<MWWorld::Ptr>::iterator it = followers.begin();it != followers.end();++it) for(std::set<MWWorld::Ptr>::iterator it = followers.begin();it != followers.end();++it)
{ {
MWWorld::Ptr follower = *it; MWWorld::Ptr follower = *it;
@ -92,7 +92,7 @@ namespace MWGui
} }
// Apply followers cost, in vanilla one follower travels for free // Apply followers cost, in vanilla one follower travels for free
price *= travellingFollowers; price *= std::max(1, travellingFollowers);
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, price, true); price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, price, true);

Loading…
Cancel
Save