mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 06:55:54 -04:00
Workaround for some AI functions being incorrectly handled as AI packages (Bug #3378)
This commit is contained in:
parent
9959b2553d
commit
93b2f09224
@ -41,6 +41,7 @@ namespace MWMechanics
|
|||||||
TypeIdActivate = 4,
|
TypeIdActivate = 4,
|
||||||
|
|
||||||
// These 3 are not really handled as Ai Packages in the MW engine
|
// These 3 are not really handled as Ai Packages in the MW engine
|
||||||
|
// For compatibility do *not* return these in the getCurrentAiPackage script function..
|
||||||
TypeIdCombat = 5,
|
TypeIdCombat = 5,
|
||||||
TypeIdPursue = 6,
|
TypeIdPursue = 6,
|
||||||
TypeIdAvoidDoor = 7
|
TypeIdAvoidDoor = 7
|
||||||
|
@ -166,10 +166,15 @@ void AiSequence::execute (const MWWorld::Ptr& actor, CharacterController& charac
|
|||||||
}
|
}
|
||||||
|
|
||||||
MWMechanics::AiPackage* package = mPackages.front();
|
MWMechanics::AiPackage* package = mPackages.front();
|
||||||
mLastAiPackage = package->getTypeId();
|
int packageTypeId = package->getTypeId();
|
||||||
|
// workaround ai packages not being handled as in the vanilla engine
|
||||||
|
if (packageTypeId != AiPackage::TypeIdCombat
|
||||||
|
&& packageTypeId != AiPackage::TypeIdPursue
|
||||||
|
&& packageTypeId != AiPackage::TypeIdAvoidDoor)
|
||||||
|
mLastAiPackage = packageTypeId;
|
||||||
|
|
||||||
// if active package is combat one, choose nearest target
|
// if active package is combat one, choose nearest target
|
||||||
if (mLastAiPackage == AiPackage::TypeIdCombat)
|
if (packageTypeId == AiPackage::TypeIdCombat)
|
||||||
{
|
{
|
||||||
std::list<AiPackage *>::iterator itActualCombat;
|
std::list<AiPackage *>::iterator itActualCombat;
|
||||||
|
|
||||||
@ -216,7 +221,6 @@ void AiSequence::execute (const MWWorld::Ptr& actor, CharacterController& charac
|
|||||||
}
|
}
|
||||||
|
|
||||||
package = mPackages.front();
|
package = mPackages.front();
|
||||||
mLastAiPackage = package->getTypeId();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user