diff Items.cpp @ 2464:104fdbea0386

cleaning project part 2
author zipi
date Sun, 17 Aug 2014 17:49:34 +0100
parents f4af3b203f65
children b054ea5daf45
line wrap: on
line diff
--- a/Items.cpp	Sun Aug 17 15:13:18 2014 +0100
+++ b/Items.cpp	Sun Aug 17 17:49:34 2014 +0100
@@ -7,7 +7,7 @@
 #include <string>
 #include "UI\UIHouses.h"
 #include "GUIButton.h"
-#include "mm7_unsorted_subs.h"
+
 #include "ErrorHandling.h"
 
 #include "Items.h"
@@ -24,6 +24,8 @@
 #include "mm7_data.h"
 #include "OurMath.h"
 
+#include "Game.h"
+
 
 struct ITEM_VARIATION
 	{
@@ -2250,4 +2252,27 @@
     }
   }
   return test;
-}
\ No newline at end of file
+}
+
+//----- (00493F79) --------------------------------------------------------
+void init_summoned_item(stru351_summoned_item *_this, __int64 duration)
+{
+	signed __int64 v2; // ST2C_8@1
+	signed __int64 v3; // qax@1
+	//signed __int64 v4; // ST1C_8@1
+	unsigned __int64 v5; // qax@1
+	unsigned int v6; // ebx@1
+
+	v2 = (signed __int64)((double)duration * 0.234375);
+	v3 = v2 / 60 / 60;
+	//v4 = v3;
+	v5 = (unsigned int)v3 / 0x18;
+	v6 = (unsigned int)(v5 / 7) >> 2;
+	_this->field_0_expire_second = v2 % 60;
+	_this->field_4_expire_minute = v2 / 60 % 60;
+	_this->field_8_expire_hour = v3 % 24;
+	_this->field_10_expire_week = v5 / 7 & 3;
+	_this->field_C_expire_day = (unsigned int)v5 % 0x1C;
+	_this->field_14_exprie_month = v6 % 0xC;
+	_this->field_18_expire_year = v6 / 0xC + game_starting_year;
+}