1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 11:53:51 +00:00

Merge pull request #2668 from Capostrophic/target

Make GetTarget return 1 during actor greeting (bug #5255)
This commit is contained in:
Bret Curtis 2020-01-20 14:23:04 +01:00 committed by GitHub
commit 3e4cedb7a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -194,6 +194,7 @@
Bug #5242: ExplodeSpell behavior differs from Cast behavior
Bug #5249: Wandering NPCs start walking too soon after they hello
Bug #5250: Creatures display shield ground mesh instead of shield body part
Bug #5255: "GetTarget, player" doesn't return 1 during NPC hello
Feature #1774: Handle AvoidNode
Feature #2229: Improve pathfinding AI
Feature #3025: Analogue gamepad movement controls

View file

@ -25,6 +25,7 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/soundmanager.hpp"
#include "interpretercontext.hpp"
#include "ref.hpp"
@ -435,6 +436,14 @@ namespace MWScript
if (!targetPtr.isEmpty() && targetPtr.getCellRef().getRefId() == testedTargetId)
targetsAreEqual = true;
}
else
{
bool turningToPlayer = creatureStats.isTurningToPlayer();
bool greeting = creatureStats.getGreetingState() == MWMechanics::Greet_InProgress;
bool sayActive = MWBase::Environment::get().getSoundManager()->sayActive(actor);
if (turningToPlayer || (greeting && sayActive))
targetsAreEqual = (testedTargetId == "player"); // Currently the player ID is hardcoded
}
runtime.push(int(targetsAreEqual));
}
};