annotate SpriteObject.cpp @ 1359:60cdc3eac407

_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
author Grumpy7
date Sat, 13 Jul 2013 17:13:45 +0200
parents 13b7be8b06a0
children 613c77e51e38
rev   line source
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1 #include <assert.h>
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
2
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 838
diff changeset
3 #include "BSPModel.h"
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
4 #include "SpriteObject.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
5 #include "Party.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
6 #include "TurnEngine.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
7 #include "MapInfo.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
8 #include "Math.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
9 #include "ObjectList.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
10 #include "Indoor.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
11 #include "Outdoor.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
12 #include "ParticleEngine.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
13 #include "Time.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
14 #include "Game.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
15 #include "LOD.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
16 #include "Actor.h"
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
17 #include "Events.h"
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
18
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
19 #include "mm7_data.h"
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
20 #include "MM7.h"
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
21
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
22
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
23
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
24
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
25
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
26
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
27
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
28
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
29 size_t uNumSpriteObjects;
1207
96a81634669e arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents: 1205
diff changeset
30 std::array<SpriteObject, MAX_SPRITE_OBJECTS> pSpriteObjects;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
31
781
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
32 //----- (00404828) --------------------------------------------------------
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
33 SpriteObject::SpriteObject()
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
34 {
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
35 field_22_glow_radius_multiplier = 1;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
36 uSoundID = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
37 uFacing = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
38 vVelocity.z = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
39 vVelocity.y = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
40 vVelocity.x = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
41 uType = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
42 uObjectDescID = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
43 field_61 = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
44 field_60_distance_related_prolly_lod = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
45 field_20 = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
46 uSpriteFrameID = 0;
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 810
diff changeset
47 spell_skill = 0;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 810
diff changeset
48 spell_level = 0;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 810
diff changeset
49 spell_id = 0;
781
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
50 field_54 = 0;
d170f23f70d1 tidy, code moving
zipi
parents: 723
diff changeset
51 }
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
52
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
53 //----- (0042F5ED) --------------------------------------------------------
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
54 int SpriteObject::Create(int yaw, int pitch, int a4, int a5)
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
55 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
56 //SpriteObject *v5; // eax@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
57 signed int v6; // ebx@2
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
58 //char *v7; // ecx@2
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
59 //signed int result; // eax@6
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
60 SpriteObject *v9; // ebx@7
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
61 int v10; // edx@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
62 int v11; // edi@18
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
63 __int16 v12; // ax@18
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
64 int v13; // ST2C_4@20
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
65 int v14; // eax@20
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
66 int v15; // [sp-28h] [bp-38h]@14
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
67 int v16; // [sp-24h] [bp-34h]@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
68 Vec3_int_ v17; // [sp-20h] [bp-30h]@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
69 int *v18; // [sp-14h] [bp-24h]@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
70 int *v19; // [sp-10h] [bp-20h]@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
71 int *v20; // [sp-Ch] [bp-1Ch]@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
72 //signed int v21; // [sp+8h] [bp-8h]@2
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
73 int angle; // [sp+Ch] [bp-4h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
74 int a4a; // [sp+1Ch] [bp+Ch]@20
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
75 int a4b; // [sp+1Ch] [bp+Ch]@20
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
76 int a5a; // [sp+20h] [bp+10h]@20
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
77
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
78 //auto a1 = this;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
79 angle = yaw;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
80 //v5 = a1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
81 if (!uObjectDescID)
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
82 return -1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
83
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
84 v6 = 1000;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
85 //v7 = (char *)&pSpriteObjects[0].uObjectDescID;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
86 /*v21 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
87 do
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
88 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
89 if ( !*(short *)v7 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
90 break;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
91 v7 += 112;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
92 ++v6;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
93 v21 = v6;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
94 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
95 while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) );*/
810
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
96 for (uint i = 0; i < MAX_SPRITE_OBJECTS; ++i)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
97 if (!pSpriteObjects[i].uObjectDescID)
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
98 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
99 v6 = i;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
100 break;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
101 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
102
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
103 if ( v6 >= 1000 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
104 return -1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
105 field_64.x = vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
106 field_64.y = vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
107 v9 = &pSpriteObjects[v6];
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
108 field_64.z = vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
109
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
110 assert(sizeof(SpriteObject) == 0x70);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
111 memcpy(v9, this, sizeof(*this));
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
112 if ( a5 == 1 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
113 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
114 v20 = &v9->vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
115 v19 = &v9->vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
116 v18 = (int *)&v9->vPosition;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
117 v17.x = vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
118 v17.y = vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
119 v17.z = vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
120 v16 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
121 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
122 goto LABEL_16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
123 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
124 if ( a5 == 2 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
125 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
126 v20 = &v9->vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
127 v19 = &v9->vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
128 v18 = (int *)&v9->vPosition;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
129 v17.x = vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
130 v17.y = vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
131 v17.z = vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
132 v16 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
133 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
134 goto LABEL_14;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
135 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
136 if ( a5 == 3 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
137 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
138 v20 = &v9->vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
139 v19 = &v9->vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
140 v18 = (int *)&v9->vPosition;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
141 v17.x = vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
142 v17.y = vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
143 v17.z = vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
144 v16 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
145 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
146 LABEL_14:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
147 v15 = 8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
148 LABEL_17:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
149 Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
150 goto LABEL_18;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
151 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
152 if ( a5 == 4 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
153 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
154 v20 = &v9->vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
155 v19 = &v9->vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
156 v18 = (int *)&v9->vPosition;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
157 v17.x = vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
158 v17.y = vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
159 v17.z = vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
160 v16 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
161 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
162 LABEL_16:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
163 v15 = 24;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
164 goto LABEL_17;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
165 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
166 LABEL_18:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
167 v11 = a4;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
168 v12 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
169 if ( a4 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
170 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
171 a4a = stru_5C6E00->Cos(angle);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
172 v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
173 a4b = stru_5C6E00->Sin(angle);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
174 a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
175 v14 = stru_5C6E00->Sin(pitch);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
176 v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
177 v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
178 v12 = (unsigned int)(v14 * v11) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
179 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
180 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
181 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
182 v9->vVelocity.y = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
183 v9->vVelocity.x = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
184 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
185 v9->vVelocity.z = v12;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
186
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
187 if ( v6 >= (signed int)uNumSpriteObjects )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
188 uNumSpriteObjects = v6 + 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
189 return v6;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
190 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
191
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
192 //----- (00471C03) --------------------------------------------------------
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
193 void SpriteObject::UpdateObject_fn0_ODM(unsigned int uLayingItemID)
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
194 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
195 SpriteObject *v1; // esi@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
196 ObjectDesc *v2; // ebx@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
197 signed int v3; // edx@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
198 int v4; // ecx@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
199 int v5; // ST04_4@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
200 int v6; // eax@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
201 int v7; // ecx@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
202 int v8; // edi@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
203 int v9; // eax@4
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
204 __int16 v10; // ax@7
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
205 int v11; // edx@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
206 int v12; // ecx@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
207 signed int v13; // edx@14
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
208 signed int v14; // edx@16
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
209 int v15; // eax@24
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
210 int v16; // eax@25
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
211 int v17; // ST10_4@25
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
212 signed int v18; // eax@25
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
213 signed int v19; // eax@28
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
214 Actor *v20; // edi@31
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
215 int v21; // eax@41
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
216 int v22; // ecx@43
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
217 __int16 v23; // bx@45
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
218 char v24; // al@46
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
219 signed int i; // edi@50
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
220 int v26; // edi@52
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
221 int v27; // eax@52
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
222 __int16 v28; // cx@55
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
223 int v29; // eax@55
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
224 signed int v30; // edi@59
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
225 BSPModel *v31; // ecx@61
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
226 ODMFace *v32; // edi@61
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
227 int v33; // eax@62
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
228 int v34; // ecx@62
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
229 int v35; // eax@63
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
230 int v36; // ecx@67
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
231 __int16 v37; // ax@67
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
232 int v38; // eax@72
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
233 int v39; // eax@72
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
234 unsigned __int64 v40; // qax@72
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
235 int v41; // eax@72
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
236 unsigned __int8 v42; // sf@74
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
237 unsigned __int8 v43; // of@74
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
238 int v44; // eax@77
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
239 __int16 v45; // bx@81
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
240 int v46; // eax@85
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
241 const char *v47; // [sp-8h] [bp-B0h]@83
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
242 enum TEXTURE_TYPE v48; // [sp-4h] [bp-ACh]@46
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
243 int v49; // [sp+Ch] [bp-9Ch]@52
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
244 int v50; // [sp+10h] [bp-98h]@52
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
245 Vec3_int_ v51; // [sp+14h] [bp-94h]@11
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
246 Particle_sw Dst; // [sp+20h] [bp-88h]@45
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
247 unsigned int uLayingItemID_; // [sp+88h] [bp-20h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
248 int v54; // [sp+8Ch] [bp-1Ch]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
249 int v55; // [sp+90h] [bp-18h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
250 int v56; // [sp+94h] [bp-14h]@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
251 int v57; // [sp+98h] [bp-10h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
252 int v58; // [sp+9Ch] [bp-Ch]@1
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
253 int on_water; // [sp+A0h] [bp-8h]@1
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
254 int v60; // [sp+A4h] [bp-4h]@11
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
255
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
256 uLayingItemID_ = uLayingItemID;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
257 v1 = &pSpriteObjects[uLayingItemID];
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
258 v58 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
259 v2 = &pObjectList->pObjects[v1->uObjectDescID];
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
260 v57 = IsTerrainSlopeTooHigh(v1->vPosition.x, v1->vPosition.y);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
261 v3 = v1->vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
262 v4 = v1->vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
263 v5 = v2->uHeight;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
264 v55 = 0;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
265 v6 = ODM_GetFloorLevel(v4, v3, v1->vPosition.z, v5, &on_water, &v55, 0);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
266 v7 = v6;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
267 v54 = v6;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
268 v8 = v6 + 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
269 if ( v1->vPosition.z <= v6 + 1 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
270 {
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
271 if ( on_water )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
272 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
273 v9 = v6 + 60;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
274 if ( v55 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
275 v9 = v7 + 30;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
276 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v9);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
277 SpriteObject::OnInteraction(uLayingItemID_);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
278 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
279 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
280 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
281 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
282 v58 = 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
283 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
284 v10 = v2->uFlags;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
285 if ( !(v2->uFlags & OBJECT_DESC_NO_GRAVITY) )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
286 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
287 if ( v58 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
288 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
289 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
290 goto LABEL_13;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
291 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
292 if ( v57 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
293 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
294 v11 = v1->vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
295 v12 = v1->vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
296 v1->vPosition.z = v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
297 ODM_GetTerrainNormalAt(v12, v11, &v51);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
298 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
299 v56 = abs(v51.y * v1->vVelocity.y + v51.z * v1->vVelocity.z + v51.x * v1->vVelocity.x) >> 16;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
300 v60 = ((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
301 v1->vVelocity.x += (unsigned int)(v56 * v51.x) >> 16;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
302 v60 = ((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
303 v1->vVelocity.y += (unsigned int)(v56 * v51.y) >> 16;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
304 v60 = ((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
305 v1->vVelocity.z += (unsigned int)(v56 * v51.z) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
306 LABEL_12:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
307 v7 = v54;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
308 goto LABEL_13;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
309 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
310 if ( v10 & 0x40 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
311 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
312 if ( v1->vPosition.z < v7 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
313 v1->vPosition.z = v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
314 if ( !_46BFFA_check_object_intercept(uLayingItemID_, 0) )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
315 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
316 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
317 v1->vPosition.z = v8;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
318 if ( !(v2->uFlags & OBJECT_DESC_BOUNCE) || (v21 = -v1->vVelocity.z >> 1, v1->vVelocity.z = v21, (signed __int16)v21 < 10) )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
319 v1->vVelocity.z = 0;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
320
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
321 v1->vVelocity.x = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.x) >> 16);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
322 v1->vVelocity.y = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.y) >> 16);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
323 v1->vVelocity.z = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.z) >> 16);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
324
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
325 if ( (v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x) < 400 )
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
326 {
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
327
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
328 v1->vVelocity.y = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
329 v1->vVelocity.x = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
330 memset(&Dst, 0, 0x68u);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
331 Dst.x = (double)v1->vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
332 Dst.y = (double)v1->vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
333 Dst.z = (double)v1->vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
334 Dst.flt_10 = 0.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
335 Dst.flt_14 = 0.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
336 Dst.flt_18 = 0.0;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
337 if (v2->uFlags & OBJECT_DESC_TRIAL_FIRE )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
338 {
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
339 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
340 Dst.uDiffuse = 0xFF3C1E;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
341 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
342 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
343 Dst.flt_28 = 1.0;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
344 pGame->pParticleEngine->AddParticle(&Dst);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
345 }
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
346 else if ( v2->uFlags & OBJECT_DESC_TRIAL_LINE)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
347 {
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
348
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
349 Dst.type = ParticleType_Line;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
350 Dst.uDiffuse = rand();
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
351 Dst.timeToLive = 64;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
352 Dst.uTextureID = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
353 Dst.flt_28 = 1.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
354 pGame->pParticleEngine->AddParticle(&Dst);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
355 }
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
356 else if ( v2->uFlags & OBJECT_DESC_TRIAL_PARTICLE )
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
357 {
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
358 Dst.type = ParticleType_Bitmap | ParticleType_8;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
359 Dst.uDiffuse = rand();
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
360 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
361 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
362 Dst.flt_28 = 1.0;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
363 pGame->pParticleEngine->AddParticle(&Dst);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
364 }
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
365 return;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
366 }
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
367 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
368 LABEL_13:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
369 if ( v1->vPosition.z > v7
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
370 && (v13 = v1->vPosition.x, v13 >= -0x8000)
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
371 && v13 <= 0x8000
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
372 && (v14 = v1->vPosition.y, v14 >= -0x8000)
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
373 && v14 <= 0x8000
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
374 && v1->vPosition.z <= 13000
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
375 || !(v2->uFlags & OBJECT_DESC_INTERACTABLE) )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
376 goto LABEL_92;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
377 if ( v1->vPosition.z < v7 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
378 v1->vPosition.z = v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
379 if ( _46BFFA_check_object_intercept(uLayingItemID_, 0) )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
380 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
381 LABEL_92:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
382 stru_721530.field_0 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
383 v55 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
384 stru_721530.prolly_normal_d = v2->uRadius;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
385 stru_721530.field_C = v2->uHeight;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
386 stru_721530.field_8 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
387 stru_721530.field_70 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
388 while ( 1 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
389 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
390 stru_721530.field_34.x = v1->vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
391 stru_721530.normal.x = stru_721530.field_34.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
392 v15 = v1->vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
393 stru_721530.uSectorID = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
394 stru_721530.field_34.y = v15;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
395 stru_721530.normal.y = v15;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
396 stru_721530.field_34.z = v1->vPosition.z + stru_721530.prolly_normal_d + 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
397 stru_721530.normal.z = stru_721530.field_34.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
398 stru_721530.field_1C = v1->vVelocity.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
399 stru_721530.field_20 = v1->vVelocity.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
400 stru_721530.field_24 = v1->vVelocity.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
401 if ( stru_721530._47050A(0) )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
402 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
403 _46E889_collide_against_bmodels(0);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
404 v16 = WorldPosToGridCellZ(v1->vPosition.y);
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
405 v18 = WorldPosToGridCellX(v1->vPosition.x);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
406 _46E26D_collide_against_sprites(v18, v16);
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
407 if (PID_TYPE(v1->spell_caster_pid) != OBJECT_Player)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
408 _46EF01_collision_chech_player(0);
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
409 if (PID_TYPE(v1->spell_caster_pid) == OBJECT_Actor)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
410 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
411 v19 = PID_ID(v1->spell_caster_pid);
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
412 if (( v19 >= 0 )&&( v19 < (signed int)(uNumActors - 1) ))
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
413 {
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
414
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
415 v20 = &pActors[v19];
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
416 for (v56 =0; v56 < uNumActors; ++v56)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
417 {
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
418 if ( v20->GetActorsRelation(&pActors[v56]) )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
419 _46DF1A_collide_against_actor(v56, 0);
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
420
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
421 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
422 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
423 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
424 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
425 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
426 for ( i = 0; i < (signed int)uNumActors; ++i )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
427 _46DF1A_collide_against_actor(i, 0);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
428 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
429 v26 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
723
256211e8243a ODM_GetFloorLevel & BLV_GetFloorLevel
Ritor1
parents: 717
diff changeset
430 v27 = ODM_GetFloorLevel(
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
431 stru_721530.normal2.x,
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
432 stru_721530.normal2.y,
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
433 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1,
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
434 v2->uHeight,
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
435 &v49,
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
436 &v50,
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
437 0);
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
438 if ( on_water && v26 < v27 + 60 )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
439 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
440 if ( v50 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
441 v44 = v27 + 30;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
442 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
443 v44 = v54 + 60;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
444 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v44);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
445 SpriteObject::OnInteraction(uLayingItemID_);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
446 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
447 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
448 if ( stru_721530.field_7C >= stru_721530.field_6C )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
449 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
450 v1->vPosition.x = stru_721530.normal2.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
451 v1->vPosition.y = stru_721530.normal2.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
452 v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
453 v1->uSectorID = LOWORD(stru_721530.uSectorID);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
454 memset(&Dst, 0, 0x68u);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
455 Dst.x = (double)v1->vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
456 Dst.y = (double)v1->vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
457 Dst.z = (double)v1->vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
458 Dst.flt_10 = 0.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
459 Dst.flt_14 = 0.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
460 Dst.flt_18 = 0.0;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
461 if ( v2->uFlags & OBJECT_DESC_TRIAL_FIRE )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
462 {
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
463 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
464 Dst.uDiffuse = 0xFF3C1E;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
465 Dst.timeToLive = (unsigned __int8)( rand() & 0x80) + 128;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
466 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
467 Dst.flt_28 = 1.0;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
468 pGame->pParticleEngine->AddParticle(&Dst);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
469 return;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
470 }
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
471 else if ( v2->uFlags & OBJECT_DESC_TRIAL_LINE )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
472 {
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
473 Dst.type = ParticleType_Line;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
474 Dst.uTextureID = 0;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
475 Dst.uDiffuse = rand();
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
476 Dst.timeToLive = 64;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
477 Dst.flt_28 = 1.0;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
478 pGame->pParticleEngine->AddParticle(&Dst);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
479 return;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
480 }
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
481 else if ( v2->uFlags & OBJECT_DESC_TRIAL_PARTICLE)
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
482 {
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
483 Dst.type = ParticleType_Bitmap | ParticleType_8;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
484 Dst.uDiffuse = rand();
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
485 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
486 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
487 Dst.flt_28 = 1.0;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
488 pGame->pParticleEngine->AddParticle(&Dst);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
489 }
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
490 return;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
491 }
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
492 v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
493 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
494 v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
495 v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
496 v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
497 v28 = LOWORD(stru_721530.uSectorID);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
498 v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
499 v29 = v1->vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
500 v1->uSectorID = v28;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
501 stru_721530.field_70 += stru_721530.field_7C;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
502 if ( v2->uFlags & OBJECT_DESC_INTERACTABLE )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
503 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
504 if ( v29 < v54 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
505 v1->vPosition.z = v54 + 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
506 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
507 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
508 }
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
509 v30 = (signed int)PID_ID(stru_721530.uFaceID);
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
510 if (PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
511 break;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
512 if (PID_TYPE(stru_721530.uFaceID) == OBJECT_BModel)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
513 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
514 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
515 v32 = &v31->pFaces[v30 & 0x3F];
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
516 if ( v32->uPolygonType != 3 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
517 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
518 v56 = abs(v32->pFacePlane.vNormal.z * v1->vVelocity.z + v32->pFacePlane.vNormal.y * v1->vVelocity.y
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
519 + v32->pFacePlane.vNormal.x * v1->vVelocity.x) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
520 if ( stru_721530.field_64 >> 3 > v56 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
521 v56 = stru_721530.field_64 >> 3;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
522 v57 = v32->pFacePlane.vNormal.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
523 v57 = (unsigned __int64)(v56 * (signed __int64)v57) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
524 v58 = v32->pFacePlane.vNormal.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
525 v58 = (unsigned __int64)(v56 * (signed __int64)v58) >> 16;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
526 v60 = v32->pFacePlane.vNormal.z;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
527 v60 = ((unsigned __int64)(v56 * (signed __int64)(signed int)v60) >> 16);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
528 v1->vVelocity.x += 2 * v57;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
529 v1->vVelocity.y += 2 * v58;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
530 if ( v32->pFacePlane.vNormal.z <= 32000 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
531 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
532 v37 = 2 * (short)v60;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
533 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
534 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
535 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
536 v36 = v60;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
537 v1->vVelocity.z += (signed __int16)v60;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
538 v58 = (unsigned __int64)(32000 * (signed __int64)(signed int)v36) >> 16;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
539 v37 = (unsigned int)(32000 * v36) >> 16;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
540 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
541 v1->vVelocity.z += v37;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
542 LABEL_70:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
543 if ( BYTE3(v32->uAttributes) & 0x10 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
544 EventProcessor(v32->sCogTriggeredID, 0, 1);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
545 goto LABEL_74;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
546 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
547 v33 = v31->pVertices.pVertices[v32->pVertexIDs[0]].z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
548 v34 = v1->vVelocity.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
549 v1->vPosition.z = v33 + 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
550 if ( v1->vVelocity.y * v1->vVelocity.y + v34 * v34 >= 400 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
551 goto LABEL_70;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
552 LOWORD(v35) = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
553 v1->vVelocity.z = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
554 v1->vVelocity.x = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
555 goto LABEL_73;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
556 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
557 LABEL_74:
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
558 v1->vVelocity.x = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.x) >> 16);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
559 v1->vVelocity.y = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.y) >> 16);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
560 v1->vVelocity.z = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.z) >> 16);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
561
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
562 ++v55;
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
563 //v43 = __OFSUB__(v55, 100);
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
564 // v42 = v55 - 100 < 0;
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
565 if (v55>=100 )//!(v42 ^ v43)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
566 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
567 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
568 v57 = integer_sqrt(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
569 v38 = stru_5C6E00->Atan2(
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
570 v1->vPosition.x - pLevelDecorations[v30].vPosition.x,
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
571 v1->vPosition.y - pLevelDecorations[v30].vPosition.y);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
572 v56 = v38;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
573 v39 = stru_5C6E00->Cos(v38);
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
574 // v60 = v39;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
575 v40 = v39 * (signed __int64)v57;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
576 v58 = v40 >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
577 v1->vVelocity.x = WORD1(v40);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
578 v41 = stru_5C6E00->Sin(v56 - stru_5C6E00->uIntegerHalfPi);
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1207
diff changeset
579 // v60 = v41;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
580 v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
581 v58 = v35;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
582 LABEL_73:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
583 v1->vVelocity.y = v35;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
584 goto LABEL_74;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
585 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
586 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
587
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
588 //----- (0047136C) --------------------------------------------------------
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
589 void SpriteObject::UpdateObject_fn0_BLV(unsigned int uLayingItemID)
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
590 {
717
Ritor1
parents: 619
diff changeset
591 SpriteObject *pSpriteObject; // esi@1
Ritor1
parents: 619
diff changeset
592 ObjectDesc *pObject; // edi@1
Ritor1
parents: 619
diff changeset
593 //int v3; // ST08_4@1
Ritor1
parents: 619
diff changeset
594 //__int16 v4; // ax@5
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
595 __int16 v5; // ax@7
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
596 BLVFace *v6; // ecx@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
597 BLVFace *v7; // eax@11
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
598 signed int v8; // ebx@12
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
599 int v9; // ecx@16
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
600 __int16 v10; // di@18
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
601 char v11; // al@19
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
602 int v12; // eax@25
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
603 int v13; // eax@31
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
604 int v14; // ebx@34
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
605 signed int v15; // ebx@46
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
606 BLVFace *v16; // edi@48
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
607 int v17; // eax@50
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
608 int v18; // eax@52
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
609 int v19; // ecx@52
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
610 Vec3_short_ *v20; // ecx@53
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
611 int v21; // ecx@57
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
612 __int16 v22; // ax@57
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
613 int v23; // edi@62
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
614 int v24; // edi@62
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
615 int v25; // eax@62
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
616 unsigned __int64 v26; // qax@62
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
617 unsigned __int8 v27; // sf@64
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
618 unsigned __int8 v28; // of@64
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
619 __int16 v29; // di@67
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
620 char v30; // al@68
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
621 const char *v31; // [sp-8h] [bp-98h]@19
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
622 const char *v32; // [sp-8h] [bp-98h]@68
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
623 enum TEXTURE_TYPE v33; // [sp-4h] [bp-94h]@19
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
624 enum TEXTURE_TYPE v34; // [sp-4h] [bp-94h]@68
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
625 Particle_sw Dst; // [sp+Ch] [bp-84h]@18
717
Ritor1
parents: 619
diff changeset
626 //unsigned int uLayingItemID_; // [sp+74h] [bp-1Ch]@1
Ritor1
parents: 619
diff changeset
627 //ObjectDesc *v37; // [sp+78h] [bp-18h]@1
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
628 unsigned int uFaceID; // [sp+7Ch] [bp-14h]@4
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
629 int v39; // [sp+80h] [bp-10h]@33
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
630 Actor *v39b;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
631 int v40; // [sp+84h] [bp-Ch]@28
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
632 int v41; // [sp+88h] [bp-8h]@34
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
633 int v42; // [sp+8Ch] [bp-4h]@4
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
634
717
Ritor1
parents: 619
diff changeset
635 //uLayingItemID_ = uLayingItemID;
Ritor1
parents: 619
diff changeset
636 pSpriteObject = &pSpriteObjects[uLayingItemID];
Ritor1
parents: 619
diff changeset
637 pObject = &pObjectList->pObjects[pSpriteObject->uObjectDescID];
Ritor1
parents: 619
diff changeset
638 //v3 = pSpriteObject->vPosition.x;
Ritor1
parents: 619
diff changeset
639 //v37 = &pObjectList->pObjects[pSpriteObject->uObjectDescID];
Ritor1
parents: 619
diff changeset
640 pSpriteObject->uSectorID = pIndoor->GetSector(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z);
723
256211e8243a ODM_GetFloorLevel & BLV_GetFloorLevel
Ritor1
parents: 717
diff changeset
641 v42 = BLV_GetFloorLevel(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z, pSpriteObject->uSectorID, &uFaceID);
717
Ritor1
parents: 619
diff changeset
642 if ( abs(pSpriteObject->vPosition.x) > 32767
Ritor1
parents: 619
diff changeset
643 || abs(pSpriteObject->vPosition.y) > 32767
Ritor1
parents: 619
diff changeset
644 || abs(pSpriteObject->vPosition.z) > 20000
Ritor1
parents: 619
diff changeset
645 || v42 <= -30000
Ritor1
parents: 619
diff changeset
646 && (pSpriteObject->uSectorID == 0))
Ritor1
parents: 619
diff changeset
647 // || (v42 = _46CEC3_get_floor_level(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z, v4, &uFaceID), v42 == -30000)) )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
648 {
717
Ritor1
parents: 619
diff changeset
649 SpriteObject::OnInteraction(uLayingItemID);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
650 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
651 }
717
Ritor1
parents: 619
diff changeset
652 v5 = pObject->uFlags;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
653 if ( v5 & 0x20 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
654 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
655 LABEL_24:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
656 v8 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
657 LABEL_25:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
658 stru_721530.field_0 = v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
659 uFaceID = v8;
717
Ritor1
parents: 619
diff changeset
660 stru_721530.prolly_normal_d = pObject->uRadius;
Ritor1
parents: 619
diff changeset
661 v12 = pObject->uHeight;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
662 stru_721530.field_84 = -1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
663 stru_721530.field_C = v12;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
664 stru_721530.field_8 = v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
665 stru_721530.field_70 = v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
666 while ( 1 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
667 {
717
Ritor1
parents: 619
diff changeset
668 stru_721530.field_34.x = pSpriteObject->vPosition.x;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
669 stru_721530.normal.x = stru_721530.field_34.x;
717
Ritor1
parents: 619
diff changeset
670 stru_721530.field_34.y = pSpriteObject->vPosition.y;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
671 stru_721530.normal.y = stru_721530.field_34.y;
717
Ritor1
parents: 619
diff changeset
672 stru_721530.field_34.z = stru_721530.prolly_normal_d + pSpriteObject->vPosition.z + 1;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
673 stru_721530.normal.z = stru_721530.field_34.z;
717
Ritor1
parents: 619
diff changeset
674 stru_721530.field_1C = pSpriteObject->vVelocity.x;
Ritor1
parents: 619
diff changeset
675 stru_721530.field_20 = pSpriteObject->vVelocity.y;
Ritor1
parents: 619
diff changeset
676 stru_721530.field_24 = pSpriteObject->vVelocity.z;
Ritor1
parents: 619
diff changeset
677 stru_721530.uSectorID = pSpriteObject->uSectorID;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
678 if ( stru_721530._47050A(v8) )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
679 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
680 v40 = v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
681 do
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
682 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
683 _46E44E_collide_against_faces_and_portals(0);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
684 _46E0B2_collide_against_decorations();
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
685 if (PID_TYPE(pSpriteObject->spell_caster_pid) != OBJECT_Player)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
686 _46EF01_collision_chech_player(1);
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 810
diff changeset
687 v13 = pSpriteObject->spell_caster_pid;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
688 v42 = v8;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
689 if (PID_TYPE(v13) == OBJECT_Actor)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
690 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
691 if ( (signed int)uNumActors > v8 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
692 {
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1071
diff changeset
693 v39b = pActors.data();//[0].word_000086_some_monster_id;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
694 do
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
695 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
696 //v41 = pActors[v1->field_58 >> 3].pMonsterInfo.uID - 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
697 //v14 = (signed __int64)((double)v41 * 0.3333333333333333);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
698 //v41 = *(short *)(v39 - 38) - 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
699 //if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) )
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 810
diff changeset
700 if( pActors[pSpriteObject->spell_caster_pid >> 3].pMonsterInfo.uID != v39b->pMonsterInfo.uID )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
701 //not sure: pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius
1071
a7e63532b9a8 pointer cleaning
zipi
parents: 1069
diff changeset
702 _46DF1A_collide_against_actor(v42, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
703 ++v42;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
704 ++v39b;// += 836;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
705 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
706 while ( v42 < (signed int)uNumActors );
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
707 v8 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
708 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
709 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
710 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
711 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
712 if ( (signed int)uNumActors > v8 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
713 {
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1071
diff changeset
714 v39b = pActors.data();//[0].word_000086_some_monster_id;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
715 do
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
716 {
1071
a7e63532b9a8 pointer cleaning
zipi
parents: 1069
diff changeset
717 _46DF1A_collide_against_actor(v42++, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
718 ++v39b;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
719 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
720 while ( v42 < (signed int)uNumActors );
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
721 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
722 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
723 if ( _46F04E_collide_against_portals() )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
724 break;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
725 ++v40;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
726 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
727 while ( v40 < 100 );
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
728 if ( stru_721530.field_7C >= stru_721530.field_6C )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
729 {
717
Ritor1
parents: 619
diff changeset
730 pSpriteObject->vPosition.x = stru_721530.normal2.x;
Ritor1
parents: 619
diff changeset
731 pSpriteObject->vPosition.y = stru_721530.normal2.y;
Ritor1
parents: 619
diff changeset
732 pSpriteObject->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
Ritor1
parents: 619
diff changeset
733 pSpriteObject->uSectorID = LOWORD(stru_721530.uSectorID);
Ritor1
parents: 619
diff changeset
734 if ( !(HIBYTE(pObject->uFlags) & 1) )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
735 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
736 memset(&Dst, v8, 0x68u);
717
Ritor1
parents: 619
diff changeset
737 v29 = pObject->uFlags;
Ritor1
parents: 619
diff changeset
738 Dst.x = (double)pSpriteObject->vPosition.x;
Ritor1
parents: 619
diff changeset
739 Dst.y = (double)pSpriteObject->vPosition.y;
Ritor1
parents: 619
diff changeset
740 Dst.z = (double)pSpriteObject->vPosition.z;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
741 Dst.flt_10 = 0.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
742 Dst.flt_14 = 0.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
743 Dst.flt_18 = 0.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
744 if ( v29 & 0x200 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
745 {
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
746 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
747 Dst.uDiffuse = 0xFF3C1E;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
748 v30 = rand();
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
749 v34 = (TEXTURE_TYPE)v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
750 v32 = "effpar01";
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
751 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
752 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
753 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
754 if ( v29 & 0x400 )
717
Ritor1
parents: 619
diff changeset
755 {
Ritor1
parents: 619
diff changeset
756 Dst.type = ParticleType_Line;
Ritor1
parents: 619
diff changeset
757 Dst.uDiffuse = rand();
Ritor1
parents: 619
diff changeset
758 Dst.timeToLive = 64;
Ritor1
parents: 619
diff changeset
759 Dst.uTextureID = v8;
Ritor1
parents: 619
diff changeset
760 Dst.flt_28 = 1.0;
Ritor1
parents: 619
diff changeset
761 pGame->pParticleEngine->AddParticle(&Dst);
Ritor1
parents: 619
diff changeset
762 return;
Ritor1
parents: 619
diff changeset
763 }
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
764 Dst.type = ParticleType_Bitmap | ParticleType_8;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
765 Dst.uDiffuse = rand();
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
766 v30 = rand();
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
767 v34 = (TEXTURE_TYPE)v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
768 v32 = "effpar03";
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
769 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
770 Dst.timeToLive = (unsigned __int8)(v30 & 0x80) + 128;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
771 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v32, v34);
717
Ritor1
parents: 619
diff changeset
772 Dst.flt_28 = 1.0;
Ritor1
parents: 619
diff changeset
773 pGame->pParticleEngine->AddParticle(&Dst);
Ritor1
parents: 619
diff changeset
774 return;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
775 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
776 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
717
Ritor1
parents: 619
diff changeset
777 pSpriteObject->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
778 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
717
Ritor1
parents: 619
diff changeset
779 pSpriteObject->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
780 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
717
Ritor1
parents: 619
diff changeset
781 pSpriteObject->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
Ritor1
parents: 619
diff changeset
782 pSpriteObject->uSectorID = LOWORD(stru_721530.uSectorID);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
783 stru_721530.field_70 += stru_721530.field_7C;
717
Ritor1
parents: 619
diff changeset
784 if ( pObject->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID, stru_721530.uFaceID) )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
785 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
786 v15 = (signed int)stru_721530.uFaceID >> 3;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
787 if (PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
788 {
717
Ritor1
parents: 619
diff changeset
789 v40 = integer_sqrt(pSpriteObject->vVelocity.x * pSpriteObject->vVelocity.x + pSpriteObject->vVelocity.y * pSpriteObject->vVelocity.y);
Ritor1
parents: 619
diff changeset
790 v23 = stru_5C6E00->Atan2(pSpriteObject->vPosition.x - pLevelDecorations[v15].vPosition.x,
Ritor1
parents: 619
diff changeset
791 pSpriteObject->vPosition.y - pLevelDecorations[v15].vPosition.y);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
792 v42 = stru_5C6E00->Cos(v23);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
793 v41 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
794 v24 = v23;
717
Ritor1
parents: 619
diff changeset
795 pSpriteObject->vVelocity.x = (unsigned int)(v42 * v40) >> 16;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
796 v25 = stru_5C6E00->Sin(v23);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
797 v42 = v25;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
798 v26 = v25 * (signed __int64)v40;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
799 v41 = v26 >> 16;
717
Ritor1
parents: 619
diff changeset
800 pSpriteObject->vVelocity.y = WORD1(v26);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
801 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
802 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
803 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
804 if (PID_TYPE(stru_721530.uFaceID) != OBJECT_BModel)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
805 goto LABEL_64;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 822
diff changeset
806 stru_721530.field_84 = (signed int)PID_ID(stru_721530.uFaceID);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
807 v16 = &pIndoor->pFaces[v15];
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
808 if ( v16->uPolygonType != 3 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
809 {
717
Ritor1
parents: 619
diff changeset
810 v42 = abs(v16->pFacePlane_old.vNormal.x * pSpriteObject->vVelocity.x + v16->pFacePlane_old.vNormal.z * pSpriteObject->vVelocity.z
Ritor1
parents: 619
diff changeset
811 + v16->pFacePlane_old.vNormal.y * pSpriteObject->vVelocity.y) >> 16;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
812 if ( stru_721530.field_64 >> 3 > v42 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
813 v42 = stru_721530.field_64 >> 3;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
814 v40 = v16->pFacePlane_old.vNormal.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
815 v40 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
816 v41 = v16->pFacePlane_old.vNormal.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
817 v41 = (unsigned __int64)(v42 * (signed __int64)v41) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
818 v39 = v16->pFacePlane_old.vNormal.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
819 v39 = (unsigned __int64)(v42 * (signed __int64)v39) >> 16;
717
Ritor1
parents: 619
diff changeset
820 pSpriteObject->vVelocity.x += 2 * v40;
Ritor1
parents: 619
diff changeset
821 pSpriteObject->vVelocity.y += 2 * v41;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
822 if ( v16->pFacePlane_old.vNormal.z <= 32000 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
823 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
824 v22 = 2 * v39;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
825 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
826 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
827 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
828 v21 = v39;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
829 v40 = 32000;
717
Ritor1
parents: 619
diff changeset
830 pSpriteObject->vVelocity.z += v39;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
831 v41 = (unsigned __int64)(v40 * (signed __int64)v21) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
832 v22 = (unsigned int)(v40 * v21) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
833 }
717
Ritor1
parents: 619
diff changeset
834 pSpriteObject->vVelocity.z += v22;
Ritor1
parents: 619
diff changeset
835 if ( BYTE3(v16->uAttributes) & 0x10 )
Ritor1
parents: 619
diff changeset
836 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1);
Ritor1
parents: 619
diff changeset
837 goto LABEL_63;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
838 }
717
Ritor1
parents: 619
diff changeset
839 if ( pObject->uFlags & 0x80 )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
840 {
717
Ritor1
parents: 619
diff changeset
841 v17 = -pSpriteObject->vVelocity.z >> 1;
Ritor1
parents: 619
diff changeset
842 pSpriteObject->vVelocity.z = v17;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
843 if ( (signed __int16)v17 < 10 )
717
Ritor1
parents: 619
diff changeset
844 pSpriteObject->vVelocity.z = 0;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
845 if ( BYTE3(v16->uAttributes) & 0x10 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
846 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
847 goto LABEL_63;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
848 }
717
Ritor1
parents: 619
diff changeset
849 v18 = pSpriteObject->vVelocity.y;
Ritor1
parents: 619
diff changeset
850 v19 = pSpriteObject->vVelocity.x;
Ritor1
parents: 619
diff changeset
851 pSpriteObject->vVelocity.z = 0;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
852 if ( v19 * v19 + v18 * v18 >= 400 )
717
Ritor1
parents: 619
diff changeset
853 {
Ritor1
parents: 619
diff changeset
854 if ( BYTE3(v16->uAttributes) & 0x10 )
Ritor1
parents: 619
diff changeset
855 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1);
Ritor1
parents: 619
diff changeset
856 goto LABEL_63;
Ritor1
parents: 619
diff changeset
857 }
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
858 v20 = pIndoor->pVertices;
717
Ritor1
parents: 619
diff changeset
859 pSpriteObject->vVelocity.z = 0;
Ritor1
parents: 619
diff changeset
860 pSpriteObject->vVelocity.y = 0;
Ritor1
parents: 619
diff changeset
861 pSpriteObject->vVelocity.x = 0;
Ritor1
parents: 619
diff changeset
862 pSpriteObject->vPosition.z = v20[*v16->pVertexIDs].z + 1;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
863 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
864 LABEL_63:
717
Ritor1
parents: 619
diff changeset
865 //v2 = v37;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
866 LABEL_64:
717
Ritor1
parents: 619
diff changeset
867 v41 = pSpriteObject->vVelocity.x;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
868 v40 = 58500;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
869 v41 = (unsigned __int64)(58500i64 * v41) >> 16;
717
Ritor1
parents: 619
diff changeset
870 pSpriteObject->vVelocity.x = v41;
Ritor1
parents: 619
diff changeset
871 v41 = pSpriteObject->vVelocity.y;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
872 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
873 v40 = 58500;
717
Ritor1
parents: 619
diff changeset
874 pSpriteObject->vVelocity.y = v41;
Ritor1
parents: 619
diff changeset
875 v41 = pSpriteObject->vVelocity.z;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
876 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
877 ++uFaceID;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
878 v28 = __OFSUB__(uFaceID, 100);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
879 v27 = uFaceID - 100 < 0;
717
Ritor1
parents: 619
diff changeset
880 pSpriteObject->vVelocity.z = v41;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
881 if ( !(v27 ^ v28) )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
882 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
883 v8 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
884 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
885 }
717
Ritor1
parents: 619
diff changeset
886 if ( v42 <= pSpriteObject->vPosition.z - 3 )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
887 {
717
Ritor1
parents: 619
diff changeset
888 pSpriteObject->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
889 goto LABEL_24;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
890 }
717
Ritor1
parents: 619
diff changeset
891 if ( !(v5 & 0x40) || _46BFFA_check_object_intercept(uLayingItemID, 0) )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
892 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
893 v6 = pIndoor->pFaces;
717
Ritor1
parents: 619
diff changeset
894 pSpriteObject->vPosition.z = v42 + 1;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
895 v7 = &v6[uFaceID];
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
896 if ( v7->uPolygonType == 3 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
897 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
898 v8 = 0;
717
Ritor1
parents: 619
diff changeset
899 pSpriteObject->vVelocity.z = 0;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
900 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
901 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
902 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
903 if ( v7->pFacePlane_old.vNormal.z < 45000 )
717
Ritor1
parents: 619
diff changeset
904 pSpriteObject->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
905 v8 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
906 }
717
Ritor1
parents: 619
diff changeset
907 v42 = pSpriteObject->vVelocity.x;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
908 uFaceID = 58500;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
909 v42 = (unsigned __int64)(58500i64 * v42) >> 16;
717
Ritor1
parents: 619
diff changeset
910 pSpriteObject->vVelocity.x = v42;
Ritor1
parents: 619
diff changeset
911 v42 = pSpriteObject->vVelocity.y;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
912 v42 = (unsigned __int64)(uFaceID * (signed __int64)v42) >> 16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
913 uFaceID = 58500;
717
Ritor1
parents: 619
diff changeset
914 pSpriteObject->vVelocity.y = v42;
Ritor1
parents: 619
diff changeset
915 v42 = pSpriteObject->vVelocity.z;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
916 v42 = (unsigned __int64)(uFaceID * (signed __int64)v42) >> 16;
717
Ritor1
parents: 619
diff changeset
917 v9 = pSpriteObject->vVelocity.x;
Ritor1
parents: 619
diff changeset
918 pSpriteObject->vVelocity.z = v42;
Ritor1
parents: 619
diff changeset
919 if ( v9 * v9 + pSpriteObject->vVelocity.y * pSpriteObject->vVelocity.y < 400 )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
920 {
717
Ritor1
parents: 619
diff changeset
921 pSpriteObject->vVelocity.z = v8;
Ritor1
parents: 619
diff changeset
922 pSpriteObject->vVelocity.y = v8;
Ritor1
parents: 619
diff changeset
923 pSpriteObject->vVelocity.x = v8;
Ritor1
parents: 619
diff changeset
924 if ( !(pObject->uFlags & 1) )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
925 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
926 memset(&Dst, v8, 0x68u);
717
Ritor1
parents: 619
diff changeset
927 v10 = pObject->uFlags;
Ritor1
parents: 619
diff changeset
928 Dst.x = (double)pSpriteObject->vPosition.x;
Ritor1
parents: 619
diff changeset
929 Dst.y = (double)pSpriteObject->vPosition.y;
Ritor1
parents: 619
diff changeset
930 Dst.z = (double)pSpriteObject->vPosition.z;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
931 Dst.flt_10 = 0.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
932 Dst.flt_14 = 0.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
933 Dst.flt_18 = 0.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
934 if ( v10 & 0x200 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
935 {
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
936 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
937 Dst.uDiffuse = 0xFF3C1E;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
938 Dst.flt_28 = 1.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
939 v11 = rand();
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
940 v33 = (TEXTURE_TYPE)v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
941 v31 = "effpar01";
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
942 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
943 else
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
944 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
945 if ( v10 & 0x400 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
946 {
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
947 Dst.type = ParticleType_Line;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
948 Dst.uDiffuse = rand();
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
949 Dst.timeToLive = 64;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
950 Dst.uTextureID = v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
951 Dst.flt_28 = 1.0;
717
Ritor1
parents: 619
diff changeset
952 pGame->pParticleEngine->AddParticle(&Dst);
Ritor1
parents: 619
diff changeset
953 return;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
954 }
619
574cc56e05e9 ParticleEngine crash in temple
Nomad
parents: 515
diff changeset
955 Dst.type = ParticleType_Bitmap | ParticleType_8;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
956 Dst.uDiffuse = rand();
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
957 Dst.flt_28 = 1.0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
958 v11 = rand();
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
959 v33 = (TEXTURE_TYPE)v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
960 v31 = "effpar03";
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
961 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
962 Dst.timeToLive = (unsigned __int8)(v11 & 0x80) + 128;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
963 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v31, v33);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
964 pGame->pParticleEngine->AddParticle(&Dst);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
965 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
966 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
967 goto LABEL_25;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
968 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
969 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
970 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
971
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
972 //----- (00438E35) --------------------------------------------------------
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
973 void SpriteObject::_438E35()
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
974 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
975 SpriteObject *v1; // edi@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
976 MapInfo *pMapInfo; // esi@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
977 int v3; // ebx@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
978 int v4; // eax@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
979 int v5; // ebx@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
980 unsigned int v6; // ecx@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
981 int v7; // edx@2
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
982 unsigned int v8; // edx@4
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
983 unsigned int v9; // edx@6
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
984 unsigned int v10; // eax@7
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
985 signed int v11; // ebx@8
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
986 Player **v12; // esi@18
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
987 signed int v13; // edi@20
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
988 int v15; // [sp+Ch] [bp-Ch]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
989 int v16; // [sp+10h] [bp-8h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
990 signed int v17; // [sp+14h] [bp-4h]@8
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
991 int v18; // [sp+14h] [bp-4h]@14
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
992
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
993 v1 = this;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
994 pMapInfo = &pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName.data())];
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
995 v3 = abs(pParty->vPosition.x - v1->vPosition.x);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
996 v15 = abs(pParty->vPosition.y - v1->vPosition.y);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
997 v16 = abs(pParty->vPosition.z + pParty->sEyelevel - v1->vPosition.z);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
998 v4 = v3;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
999 v5 = v15;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1000 v6 = v16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1001 if ( v4 < v15 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1002 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1003 v7 = v4;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1004 v4 = v15;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1005 v5 = v7;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1006 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1007 if ( v4 < v16 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1008 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1009 v8 = v4;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1010 v4 = v16;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1011 v6 = v8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1012 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1013 if ( v5 < (signed int)v6 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1014 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1015 v9 = v6;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1016 v6 = v5;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1017 v5 = v9;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1018 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1019 v10 = ((unsigned int)(11 * v5) >> 5) + (v6 >> 2) + v4;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1020 if ( (signed int)v10 <= 768 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1021 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1022 v17 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1023 v11 = 5;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1024 if ( pMapInfo->Trap_D20 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1025 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1026 do
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1027 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1028 ++v17;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1029 v11 += rand() % 20 + 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1030 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1031 while ( v17 < pMapInfo->Trap_D20 );
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1032 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1033 switch ( v1->uType )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1034 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1035 case 0x32Bu:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1036 v18 = 0;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1037 break;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1038 case 0x32Cu:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1039 v18 = 1;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1040 break;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1041 case 0x32Du:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1042 v18 = 2;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1043 break;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1044 default:
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1045 //LOWORD(v10) = v1->uItemType - 814;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1046 if ( v1->uType != 814 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1047 return;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1048 v18 = 8;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1049 break;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1050 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1051 v12 = &pPlayers[1];
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1052 do
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1053 {
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1054 if ( (*v12)->CanAct() && (v13 = (*v12)->GetPerception() + 20, rand() % v13 > 20) )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1055 (*v12)->PlaySound(SPEECH_6, 0);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1056 else
1036
7f8be9f9769e player recieve damage
Gloval
parents: 1016
diff changeset
1057 (*v12)->ReceiveDamage(v11, (DAMAGE_TYPE)v18);
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1058 ++v12;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1059 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1060 while ( (signed int)v12 <= (signed int)&pPlayers[4] );
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1061 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1062 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1063
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1064 //----- (0042F933) --------------------------------------------------------
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1065 void SpriteObject::OnInteraction(unsigned int uLayingItemID)
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1066 {
837
bebc19f3d2af Save/load work with some problems
Gloval
parents: 810
diff changeset
1067 pSpriteObjects[uLayingItemID].uObjectDescID = 0;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1068 if ( pParty->bTurnBasedModeOn == 1 )
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1069 {
837
bebc19f3d2af Save/load work with some problems
Gloval
parents: 810
diff changeset
1070 if (pSpriteObjects[uLayingItemID].uAttributes & 4 )
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1071 {
1062
e23a79658fc5 some BYTE errors fixed
zipi
parents: 1036
diff changeset
1072 pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1073 --pTurnEngine->field_1C;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1074 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1075 }
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff changeset
1076 }
810
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1077
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1078
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1079 //----- (0042FA22) --------------------------------------------------------
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1080 void CompactLayingItemsList()
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1081 {
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1082 int new_obj_pos=0;
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1083
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1084 for (int i=0; i<MAX_SPRITE_OBJECTS; ++i)
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1085 {
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1086 if (pSpriteObjects[i].uObjectDescID)
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1087 memcpy(&pSpriteObjects[new_obj_pos++], &pSpriteObjects[i],sizeof(SpriteObject));
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1088 }
f5156b8c61ad savegame refactoring
Gloval
parents: 781
diff changeset
1089 uNumSpriteObjects = new_obj_pos;
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1090 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1091 //----- (00408896) --------------------------------------------------------
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1092 void InitializeSpriteObjects()
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1093 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1094 for (uint i = 0; i < uNumSpriteObjects; ++i)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1095 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1096 auto item = &pSpriteObjects[i];
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1097
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1098 if (item->uType &&
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1099 (item->uSoundID & 8 || pObjectList->pObjects[item->uType].uFlags & 0x10))
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1100 SpriteObject::OnInteraction(i);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1101 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1102
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1103 for (uint i = 0; i < 100; ++i)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1104 array_5118E8.pElements[i].field_C_time_left = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1105 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1106 //----- (0046BEF1) --------------------------------------------------------
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1107 void SpriteObject::_46BEF1_apply_spells_aoe()
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1108 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1109 SpriteObject *v1; // edi@1
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1110 Actor *v2; // esi@2
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1111 __int16 v3; // fps@4
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1112 unsigned __int8 v4; // c0@4
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1113 unsigned __int8 v5; // c3@4
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1114 signed int v6; // [sp+8h] [bp-4h]@1
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1115
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1116 int v7,v8,v9,v10,v11;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1117
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1118 v6 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1119 v1 = this;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1120 if ( (signed int)uNumActors > 0 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1121 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1122 v2 = pActors.data();//[0].vPosition.y;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1123 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1124 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1125 if ( v2->CanAct() )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1126 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1127 //UNDEF(v3);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1128 //.text:0046BF26 movsx eax, word ptr [esi-2]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1129 //.text:0046BF2A sub eax, [edi+4]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1130 //.text:0046BF31 mov [ebp+var_8], eax
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1131 //.text:0046BF37 fild [ebp+var_8]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1132 // v7 pushed to stack
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1133 v7 = v2->vPosition.x - this->vPosition.x;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1134
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1135 //.text:0046BF2D movsx ecx, word ptr [esi+2]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1136 v8 = v2->vPosition.z;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1137
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1138 //.text:0046BF34 movsx eax, word ptr [esi]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1139 //.text:0046BF3A sub eax, [edi+8]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1140 //.text:0046BF3D mov [ebp+var_8], eax
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1141 //.text:0046BF44 fild [ebp+var_8]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1142 // v9 pushed to stack
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1143 v9 = v2->vPosition.y - this->vPosition.y;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1144
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1145 //.text:0046BF40 movsx eax, word ptr [esi-6]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1146 //.text:0046BF47 sar eax, 1
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1147 //.text:0046BF49 add eax, ecx
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1148 //.text:0046BF4B sub eax, [edi+0Ch]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1149 //.text:0046BF4E mov [ebp+var_8], eax
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1150 //.text:0046BF51 fild [ebp+var_8]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1151 //.text:0046BF58 fld st
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1152 // v10 pushed to stack, two times
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1153 v10 = v2->uActorHeight / 2 + v8 - this->vVelocity.y;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1154
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1155 //.text:0046BF54 movsx eax, word ptr [esi-8]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1156 //.text:0046BF5A add eax, 100h
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1157 //.text:0046BF63 mov ecx, eax
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1158 v11 = this->vVelocity.x;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1159
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1160 //.text:0046BF5F fmul st, st(1)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1161 // stack: v10*v10, v10, v9, v7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1162 //.text:0046BF61 fld st(2)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1163 // stack: v7, v10*v10, v10, v9, v7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1164
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1165
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1166 //.text:0046BF65 fmul st, st(3)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1167 // stack: v7*v9, v10*v10, v10, v9, v7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1168
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1169 //.text:0046BF67 imul ecx, eax
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1170 v11 = v11 * v11;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1171
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1172 //.text:0046BF6A faddp st(1), st
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1173 // stack: v10*v10+v7*v9, v10, v9, v7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1174 //.text:0046BF6C fld st(3)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1175 // stack: v7, v10*v10+v7*v9, v10, v9, v7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1176 //.text:0046BF6E fmul st, st(4)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1177 // stack: v7*v7, v10*v10+v7*v9, v10, v9, v7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1178 //.text:0046BF70 faddp st(1), st
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1179 // stack: v10*v10+v7*v9+v7*v7, v10, v9, v7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1180
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1181 //.text:0046BF72 mov [ebp+var_8], ecx
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1182 //.text:0046BF75 fild [ebp+var_8]
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1183 // v11 pushed to stack
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1184
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1185 //.text:0046BF78 fcompp
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1186 // if ( v11 > v10*v10+v7*v9+v7*v7 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1187 // stack: v10, v9, v7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1188
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1189 //.text:0046BF7A fstp st
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1190 // stack: v9, v7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1191
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1192 //.text:0046BF7C fnstsw ax
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1193 //.text:0046BF7E fstp st
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1194 // stack: v7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1195
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1196 //.text:0046BF80 test ah, 41h
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1197 //.text:0046BF83 fstp st
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1198 //.text:0046BF85 jnz short loc_46BFDD
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1199
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1200 if ( v11 >= v10*v10+v7*v9+v7*v7 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1201 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1202 if ( stru_50C198.GetMagicalResistance(v2, 0xAu) )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1203 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1204 v2->pActorBuffs[v1->spell_id].Apply(
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1205 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->spell_level << 7) * 0.033333335),
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1206 v1->spell_skill,
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1207 4u,
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1208 0,
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1209 0);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1210 HIWORD(v2->uAttributes) |= 8u;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1211 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1212 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1213 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1214 ++v6;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1215 ++v2;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1216 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1217 while ( v6 < (signed int)uNumActors );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1218 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1267
diff changeset
1219 }