diff Party.cpp @ 592:96f48cfdd657

some flags
author Nomad
date Wed, 06 Mar 2013 15:55:35 +0200
parents fcbb3c281217
children 8ef867ae88b9
line wrap: on
line diff
--- a/Party.cpp	Wed Mar 06 06:41:36 2013 +0200
+++ b/Party.cpp	Wed Mar 06 15:55:35 2013 +0200
@@ -200,36 +200,29 @@
 //----- (00492AD5) --------------------------------------------------------
 __int16 Party::SetFood(unsigned int uNumFood)
 {
-  __int16 result; // ax@1
-
   pUIAnim_Food->uAnimTime = 0;
   pParty->uNumFoodRations = uNumFood;
-  result = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
-  pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
-  return result;
+  pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
 }
 
 //----- (00492B03) --------------------------------------------------------
 void Party::TakeFood(unsigned int uNumFood)
 {
-  if ( ((pParty->uNumFoodRations - uNumFood) & 0x80000000u) == 0 )
-    pParty->uNumFoodRations -= uNumFood;
+  if (pParty->uNumFoodRations <= uNumFood)
+    pParty->uNumFoodRations = 0;
   else
-    pParty->uNumFoodRations = 0;
+    pParty->uNumFoodRations -= uNumFood;
+
   pUIAnim_Food->uAnimTime = 0;
-  pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
+  pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
 }
 
 //----- (00492B42) --------------------------------------------------------
-__int16 Party::GiveFood(unsigned int _this)
+void Party::GiveFood(unsigned int _this)
 {
-  __int16 result; // ax@1
-
   pParty->uNumFoodRations += _this;
   pUIAnim_Food->uAnimTime = 0;
-  result = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
-  pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
-  return result;
+  pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
 }
 
 //----- (00492B70) --------------------------------------------------------
@@ -237,7 +230,7 @@
 {
   pParty->uNumGold = uNumGold;
   pUIAnim_Gold->uAnimTime = 0;
-  pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength;
+  pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Gold->uIconID].uAnimLength;
   pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
 }
 
@@ -249,7 +242,7 @@
   else
     pParty->uNumGold = 0;
   pUIAnim_Gold->uAnimTime = 0;
-  pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength;
+  pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Gold->uIconID].uAnimLength;
   pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
 }