mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 00:26:39 +00:00 
			
		
		
		
	Merge pull request #2668 from Capostrophic/target
Make GetTarget return 1 during actor greeting (bug #5255)
This commit is contained in:
		
						commit
						3e4cedb7a8
					
				
					 2 changed files with 10 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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));
 | 
			
		||||
                }
 | 
			
		||||
        };
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue