mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-24 14:23:11 +00:00
Don't stack cast packages
This commit is contained in:
parent
b770373491
commit
29921bf9fa
3 changed files with 15 additions and 6 deletions
|
|
@ -31,6 +31,7 @@
|
||||||
Bug #6165: Paralyzed player character can pickup items when the inventory is open
|
Bug #6165: Paralyzed player character can pickup items when the inventory is open
|
||||||
Bug #6174: Spellmaking and Enchanting sliders differences from vanilla
|
Bug #6174: Spellmaking and Enchanting sliders differences from vanilla
|
||||||
Bug #6184: Command and Calm and Demoralize and Frenzy and Rally magic effects inconsistencies with vanilla
|
Bug #6184: Command and Calm and Demoralize and Frenzy and Rally magic effects inconsistencies with vanilla
|
||||||
|
Bug #6197: Infinite Casting Loop
|
||||||
Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record
|
Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record
|
||||||
Feature #2780: A way to see current OpenMW version in the console
|
Feature #2780: A way to see current OpenMW version in the console
|
||||||
Feature #3616: Allow Zoom levels on the World Map
|
Feature #3616: Allow Zoom levels on the World Map
|
||||||
|
|
|
||||||
|
|
@ -361,11 +361,12 @@ void AiSequence::stack (const AiPackage& package, const MWWorld::Ptr& actor, boo
|
||||||
// insert new package in correct place depending on priority
|
// insert new package in correct place depending on priority
|
||||||
for (auto it = mPackages.begin(); it != mPackages.end(); ++it)
|
for (auto it = mPackages.begin(); it != mPackages.end(); ++it)
|
||||||
{
|
{
|
||||||
// We should keep current AiCast package, if we try to add a new one.
|
// We should override current AiCast package, if we try to add a new one.
|
||||||
if ((*it)->getTypeId() == MWMechanics::AiPackageTypeId::Cast &&
|
if ((*it)->getTypeId() == MWMechanics::AiPackageTypeId::Cast &&
|
||||||
package.getTypeId() == MWMechanics::AiPackageTypeId::Cast)
|
package.getTypeId() == MWMechanics::AiPackageTypeId::Cast)
|
||||||
{
|
{
|
||||||
continue;
|
*it = package.clone();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((*it)->getPriority() <= package.getPriority())
|
if((*it)->getPriority() <= package.getPriority())
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
#include "../mwbase/mechanicsmanager.hpp"
|
||||||
#include "../mwbase/scriptmanager.hpp"
|
#include "../mwbase/scriptmanager.hpp"
|
||||||
#include "../mwbase/soundmanager.hpp"
|
#include "../mwbase/soundmanager.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
|
@ -1233,8 +1234,11 @@ namespace MWScript
|
||||||
|
|
||||||
if (ptr.getClass().isActor())
|
if (ptr.getClass().isActor())
|
||||||
{
|
{
|
||||||
MWMechanics::AiCast castPackage(targetId, spellId, true);
|
if (!MWBase::Environment::get().getMechanicsManager()->isCastingSpell(ptr))
|
||||||
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(castPackage, ptr);
|
{
|
||||||
|
MWMechanics::AiCast castPackage(targetId, spellId, true);
|
||||||
|
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(castPackage, ptr);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1276,8 +1280,11 @@ namespace MWScript
|
||||||
|
|
||||||
if (ptr.getClass().isActor())
|
if (ptr.getClass().isActor())
|
||||||
{
|
{
|
||||||
MWMechanics::AiCast castPackage(ptr.getCellRef().getRefId(), spellId, true);
|
if (!MWBase::Environment::get().getMechanicsManager()->isCastingSpell(ptr))
|
||||||
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(castPackage, ptr);
|
{
|
||||||
|
MWMechanics::AiCast castPackage(ptr.getCellRef().getRefId(), spellId, true);
|
||||||
|
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(castPackage, ptr);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue