mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 15:41:13 -04:00
AiWander: Make sure we have 8 idle values (Fixes #1583)
The AiWander instruction may specify more (or less) than 8.
This commit is contained in:
parent
523c2715e3
commit
92f5898b32
@ -26,6 +26,7 @@ namespace MWMechanics
|
|||||||
AiWander::AiWander(int distance, int duration, int timeOfDay, const std::vector<unsigned char>& idle, bool repeat):
|
AiWander::AiWander(int distance, int duration, int timeOfDay, const std::vector<unsigned char>& idle, bool repeat):
|
||||||
mDistance(distance), mDuration(duration), mTimeOfDay(timeOfDay), mIdle(idle), mRepeat(repeat)
|
mDistance(distance), mDuration(duration), mTimeOfDay(timeOfDay), mIdle(idle), mRepeat(repeat)
|
||||||
{
|
{
|
||||||
|
mIdle.resize(8, 0);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -652,7 +653,7 @@ namespace MWMechanics
|
|||||||
wander->mData.mDuration = mDuration;
|
wander->mData.mDuration = mDuration;
|
||||||
wander->mData.mTimeOfDay = mTimeOfDay;
|
wander->mData.mTimeOfDay = mTimeOfDay;
|
||||||
wander->mStartTime = mStartTime.toEsm();
|
wander->mStartTime = mStartTime.toEsm();
|
||||||
assert (mIdle.size() >= 8);
|
assert (mIdle.size() == 8);
|
||||||
for (int i=0; i<8; ++i)
|
for (int i=0; i<8; ++i)
|
||||||
wander->mData.mIdle[i] = mIdle[i];
|
wander->mData.mIdle[i] = mIdle[i];
|
||||||
wander->mData.mShouldRepeat = mRepeat;
|
wander->mData.mShouldRepeat = mRepeat;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user