diff Party.cpp @ 1369:6b4a1c44a56f

Merge
author Gloval
date Mon, 15 Jul 2013 08:20:28 +0400
parents 9014784ae84f
children b51332ab228f
line wrap: on
line diff
--- a/Party.cpp	Mon Jul 15 08:18:35 2013 +0400
+++ b/Party.cpp	Mon Jul 15 08:20:28 2013 +0400
@@ -26,6 +26,7 @@
 #include "Sprites.h"
 #include "SpriteObject.h"
 #include "ObjectList.h"
+#include "Conditions.h"
 
 Party *pParty; // idb
 
@@ -949,7 +950,7 @@
 
 
     auto condition = player->GetMajorConditionIdx();
-    if (condition == Player::Condition_Good || condition == Player::Condition_Zombie)
+    if (condition == Condition_Good || condition == Condition_Zombie)
     {
       if (player->uExpressionTimePassed < player->uExpressionTimeLength)
         continue;
@@ -999,23 +1000,23 @@
 
       switch (condition)
       {
-        case Player::Condition_Dead:        player->expression = CHARACTER_EXPRESSION_DEAD;      break;
-        case Player::Condition_Pertified:   player->expression = CHARACTER_EXPRESSION_PERTIFIED; break;
-        case Player::Condition_Eradicated:  player->expression = CHARACTER_EXPRESSION_ERADICATED; break;
-        case Player::Condition_Cursed:      player->expression = CHARACTER_EXPRESSION_CURSED; break;
-        case Player::Condition_Weak:        player->expression = CHARACTER_EXPRESSION_WEAK; break;
-        case Player::Condition_Sleep:       player->expression = CHARACTER_EXPRESSION_SLEEP; break;
-        case Player::Condition_Fear:        player->expression = CHARACTER_EXPRESSION_FEAR; break;
-        case Player::Condition_Drunk:       player->expression = CHARACTER_EXPRESSION_DRUNK; break;
-        case Player::Condition_Insane:      player->expression = CHARACTER_EXPRESSION_INSANE; break;
-        case Player::Condition_Poison1:
-        case Player::Condition_Poison2:
-        case Player::Condition_Poison3:     player->expression = CHARACTER_EXPRESSION_POISONED; break;
-        case Player::Condition_Disease1:
-        case Player::Condition_Disease2:
-        case Player::Condition_Disease3:    player->expression = CHARACTER_EXPRESSION_DISEASED; break;
-        case Player::Condition_Paralyzed:   player->expression = CHARACTER_EXPRESSION_PARALYZED; break;
-        case Player::Condition_Unconcious:  player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break;
+        case Condition_Dead:        player->expression = CHARACTER_EXPRESSION_DEAD;      break;
+        case Condition_Pertified:   player->expression = CHARACTER_EXPRESSION_PERTIFIED; break;
+        case Condition_Eradicated:  player->expression = CHARACTER_EXPRESSION_ERADICATED; break;
+        case Condition_Cursed:      player->expression = CHARACTER_EXPRESSION_CURSED; break;
+        case Condition_Weak:        player->expression = CHARACTER_EXPRESSION_WEAK; break;
+        case Condition_Sleep:       player->expression = CHARACTER_EXPRESSION_SLEEP; break;
+        case Condition_Fear:        player->expression = CHARACTER_EXPRESSION_FEAR; break;
+        case Condition_Drunk:       player->expression = CHARACTER_EXPRESSION_DRUNK; break;
+        case Condition_Insane:      player->expression = CHARACTER_EXPRESSION_INSANE; break;
+        case Condition_Poison1:
+        case Condition_Poison2:
+        case Condition_Poison3:     player->expression = CHARACTER_EXPRESSION_POISONED; break;
+        case Condition_Disease1:
+        case Condition_Disease2:
+        case Condition_Disease3:    player->expression = CHARACTER_EXPRESSION_DISEASED; break;
+        case Condition_Paralyzed:   player->expression = CHARACTER_EXPRESSION_PARALYZED; break;
+        case Condition_Unconcious:  player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break;
         default:
           assert(false);
       }
@@ -1153,6 +1154,7 @@
   }
   pParty->days_played_without_rest = 0;
 }
+
 //----- (004938D1) --------------------------------------------------------
 void __fastcall Rest(unsigned int uHoursToSleep)
 {
@@ -1458,7 +1460,7 @@
       v4 = v3->AddItem(-1, pParty->pPickedItem.uItemID);
       if ( v4 )
 	  {
-		memcpy(&pParty->pPlayers[v12].pInventoryItems[v4], &pParty->pPickedItem, 0x24u);
+		memcpy(&pParty->pPlayers[v12].pInventoryItems[v4 - 1], &pParty->pPickedItem, 0x24u);
 		pMouse->RemoveHoldingItem();
 		break;
 	  }
@@ -1513,4 +1515,15 @@
     pIcons_LOD->SyncLoadedFilesCount();
   }
   return 1;
+}
+
+
+bool Party::IsPartyEvil()
+{
+  return _449B57_test_bit(_quest_bits, 100);
+}
+
+bool Party::IsPartyGood()
+{
+  return _449B57_test_bit(_quest_bits, 99);
 }
\ No newline at end of file