1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 06:53:52 +00:00

fixed StartCombat script

This commit is contained in:
mrcheko 2014-01-18 12:55:17 +02:00
parent df4df5b094
commit 969340d61b

View file

@ -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) ));
}
};