diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-12-09 08:28:39 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-12-09 08:28:39 -0500 |
commit | 4e3ceb550b26e3b7810b4493943db98918d7bef1 (patch) | |
tree | 7f83d7903da5a52e854e974e6be0a8960241352f /src/entities.cpp | |
parent | 04481c298a5df5dd0327d64284db9ed80bf619e4 (diff) |
npc facing
Diffstat (limited to 'src/entities.cpp')
-rw-r--r-- | src/entities.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/entities.cpp b/src/entities.cpp index f2d7270..08af0a9 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -313,6 +313,10 @@ void NPC::interact(){ //have the npc's interact back to the player if(aiFunc.size()){ func=aiFunc.front(); canMove=false; + + left = (player->loc.x < loc.x); + right = !left; + if(!func(this)){ if(aiFunc.size())aiFunc.erase(aiFunc.begin()); } |