diff Actor.cpp @ 1638:ccde94f02b75

class IndoorCamera split into BLVRenderParams and ODMRenderParams
author Nomad
date Tue, 17 Sep 2013 15:40:09 +0200
parents c58916c53d8e
children afc1c3514dd5
line wrap: on
line diff
--- a/Actor.cpp	Tue Sep 17 14:10:41 2013 +0200
+++ b/Actor.cpp	Tue Sep 17 15:40:09 2013 +0200
@@ -17,7 +17,6 @@
 #include "ObjectList.h"
 #include "Overlays.h"
 #include "Events.h"
-#include "IndoorCamera.h"
 #include "FactionTable.h"
 #include "TurnEngine.h"
 #include "MapInfo.h"
@@ -26,6 +25,7 @@
 #include "LOD.h"
 #include "Party.h"
 #include "GUIWindow.h"
+#include "Outdoor_stuff.h"
 
 #include "MM7.h"
 #include "SpriteObject.h"
@@ -2927,7 +2927,12 @@
 
   actor->uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[actor->pSpriteIDs[ANIM_Bored]].uAnimLength;
 
-  v7 = stru_5C6E00->Atan2(actor->vPosition.x - pIndoorCamera->pos.x, actor->vPosition.y - pIndoorCamera->pos.y);
+  if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
+    v7 = stru_5C6E00->Atan2(actor->vPosition.x - pODMRenderParams->vPartyPos.x, actor->vPosition.y - pODMRenderParams->vPartyPos.y);
+  else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
+    v7 = stru_5C6E00->Atan2(actor->vPosition.x - pBLVRenderParams->vPartyPos.x, actor->vPosition.y - pBLVRenderParams->vPartyPos.y);
+  else Error("(%u)", uCurrentlyLoadedLevelType);
+
   v9 = stru_5C6E00->uIntegerPi + actor->uYawAngle + ((signed int)stru_5C6E00->uIntegerPi >> 3) - v7;
 
   if ( BYTE1(v9) & 7 )      // turned away - just stand