diff --git a/apps/opencs/view/render/pathgrid.cpp b/apps/opencs/view/render/pathgrid.cpp index 2a65001c86..989f5b6b1b 100644 --- a/apps/opencs/view/render/pathgrid.cpp +++ b/apps/opencs/view/render/pathgrid.cpp @@ -316,7 +316,7 @@ namespace CSVRender for (size_t row = source->mEdges.size(); row > 0; --row) { commands.push( - new CSMWorld::DeleteNestedCommand(*model, idString, static_cast(row), parentColumn)); + new CSMWorld::DeleteNestedCommand(*model, idString, static_cast(row - 1), parentColumn)); } } } diff --git a/components/nifosg/particle.cpp b/components/nifosg/particle.cpp index a554c986de..f64116eb9c 100644 --- a/components/nifosg/particle.cpp +++ b/components/nifosg/particle.cpp @@ -487,8 +487,7 @@ namespace NifOsg } else { - int randomIndex - = static_cast(std::floor(Misc::Rng::rollClosedProbability() * (mTargets.size() - 1))); + size_t randomIndex = Misc::Rng::rollDice(mTargets.size()); recIndex = mTargets[randomIndex]; }