Merge pull request #2117 from Capostrophic/aidata

Make Interiors of Illusion puzzle of Sotha Sil Expanded work (bug #4778)
pull/541/head
Bret Curtis 6 years ago committed by GitHub
commit 93e566a08e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,6 +14,7 @@
Bug #4746: Non-solid player can't run or sneak
Bug #4750: Sneaking doesn't work in first person view if the player is in attack ready state
Bug #4768: Fallback numerical value recovery chokes on invalid arguments
Bug #4778: Interiors of Illusion puzzle in Sotha Sil Expanded mod is broken
Feature #2229: Improve pathfinding AI
Feature #3442: Default values for fallbacks from ini file
Feature #3610: Option to invert X axis

@ -431,6 +431,12 @@ namespace MWScript
std::string effect = runtime.getStringLiteral(runtime[0].mInteger);
runtime.pop();
if (!ptr.getClass().isActor())
{
runtime.push(0);
return;
}
char *end;
long key = strtol(effect.c_str(), &end, 10);
if(key < 0 || key > 32767 || *end != '\0')
@ -659,6 +665,12 @@ namespace MWScript
std::string id = runtime.getStringLiteral(runtime[0].mInteger);
runtime.pop();
if (!ptr.getClass().isActor())
{
runtime.push(0);
return;
}
const MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
runtime.push(stats.getActiveSpells().isSpellActive(id) || stats.getSpells().isSpellActive(id));
}

@ -536,7 +536,7 @@ namespace MWScript
Interpreter::Type_Integer value = 0;
if (ptr.getClass().getCreatureStats(ptr).getSpells().hasSpell(id))
if (ptr.getClass().isActor() && ptr.getClass().getCreatureStats(ptr).getSpells().hasSpell(id))
value = 1;
runtime.push (value);

@ -23,6 +23,7 @@ namespace ESM {
mScale = 1.f;
mHasAI = false;
mAiData.blank();
bool hasName = false;
bool hasNpdt = false;
@ -160,7 +161,6 @@ namespace ESM {
mSpells.mList.clear();
mHasAI = false;
mAiData.blank();
mAiData.mServices = 0;
mAiPackage.mList.clear();
mTransport.mList.clear();
}

@ -18,6 +18,7 @@ namespace ESM
mInventory.mList.clear();
mTransport.mList.clear();
mAiPackage.mList.clear();
mAiData.blank();
mHasAI = false;
bool hasName = false;

Loading…
Cancel
Save