mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 09:45:33 +00:00
fixed StartCombat script
This commit is contained in:
parent
df4df5b094
commit
969340d61b
1 changed files with 4 additions and 7 deletions
|
@ -432,17 +432,14 @@ namespace MWScript
|
||||||
virtual void execute (Interpreter::Runtime &runtime)
|
virtual void execute (Interpreter::Runtime &runtime)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr actor = R()(runtime);
|
MWWorld::Ptr actor = R()(runtime);
|
||||||
std::string actorID = runtime.getStringLiteral (runtime[0].mInteger);
|
std::string targetID = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWMechanics::CreatureStats& creatureStats = actor.getClass().getCreatureStats(actor);
|
MWMechanics::CreatureStats& creatureStats = actor.getClass().getCreatureStats(actor);
|
||||||
|
|
||||||
if (actorID == "player")
|
|
||||||
{
|
|
||||||
creatureStats.setHostile(true);
|
creatureStats.setHostile(true);
|
||||||
creatureStats.getAiSequence().stack(
|
creatureStats.getAiSequence().stack(
|
||||||
MWMechanics::AiCombat(MWBase::Environment::get().getWorld()->getPtr(actorID,true)));
|
MWMechanics::AiCombat(MWBase::Environment::get().getWorld()->getPtr(targetID, true) ));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue