fixed StartCombat script

actorid
mrcheko 11 years ago
parent df4df5b094
commit 969340d61b

@ -432,17 +432,14 @@ namespace MWScript
virtual void execute (Interpreter::Runtime &runtime)
{
MWWorld::Ptr actor = R()(runtime);
std::string actorID = runtime.getStringLiteral (runtime[0].mInteger);
std::string targetID = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWMechanics::CreatureStats& creatureStats = actor.getClass().getCreatureStats(actor);
if (actorID == "player")
{
creatureStats.setHostile(true);
creatureStats.getAiSequence().stack(
MWMechanics::AiCombat(MWBase::Environment::get().getWorld()->getPtr(actorID,true)));
}
creatureStats.setHostile(true);
creatureStats.getAiSequence().stack(
MWMechanics::AiCombat(MWBase::Environment::get().getWorld()->getPtr(targetID, true) ));
}
};

Loading…
Cancel
Save