diff --git a/CHANGELOG.md b/CHANGELOG.md index bb5f7c9bc..da4dcc45a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ Bug #4453: Quick keys behaviour is invalid for equipment Bug #4454: AI opens doors too slow Bug #4457: Item without CanCarry flag prevents shield autoequipping in dark areas + Bug #4458: AiWander console command handles idle chances incorrectly Feature #4256: Implement ToggleBorders (TB) console command Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results Feature #4222: 360° screenshots diff --git a/apps/openmw/mwscript/aiextensions.cpp b/apps/openmw/mwscript/aiextensions.cpp index c98e0fc5a..c51a55b50 100644 --- a/apps/openmw/mwscript/aiextensions.cpp +++ b/apps/openmw/mwscript/aiextensions.cpp @@ -193,10 +193,18 @@ namespace MWScript Interpreter::Type_Integer time = static_cast(runtime[0].mFloat); runtime.pop(); + // Chance for Idle is unused + if (arg0) + { + --arg0; + runtime.pop(); + } + std::vector idleList; bool repeat = false; - for(int i=1; i < 10 && arg0; ++i) + // Chances for Idle2-Idle9 + for(int i=2; i<=9 && arg0; ++i) { if(!repeat) repeat = true;