MCPcopy Create free account
hub / github.com/crossuo/crossuo / IsSitting

Method IsSitting

src/GameObjects/GameCharacter.cpp:172–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172int CGameCharacter::IsSitting()
173{
174 int result = 0;
175 if (IsHuman() && !IsMounted() && !IsFlying() &&
176 !TestStepNoChangeDirection(GetGroupForAnimation(0, true)))
177 {
178 CRenderWorldObject *obj = this;
179 while (obj != nullptr && obj->m_PrevXY != nullptr)
180 {
181 obj = obj->m_PrevXY;
182 }
183
184 while (obj != nullptr && result == 0)
185 {
186 if (obj->IsStaticGroupObject() && abs(m_Z - obj->GetZ()) <= 1) //m_Z == obj->GetZ()
187 {
188 uint16_t graphic = obj->Graphic;
189 /*
190 if (obj->IsGameObject())
191 {
192 if (((CGameObject *)obj)->NPC || ((CGameItem *)obj)->MultiBody)
193 {
194 graphic = 0;
195 }
196 }
197 */
198 switch (graphic)
199 {
200 case 0x0459:
201 case 0x045A:
202 case 0x045B:
203 case 0x045C:
204 case 0x0A2A:
205 case 0x0A2B:
206 case 0x0B2C:
207 case 0x0B2D:
208 case 0x0B2E:
209 case 0x0B2F:
210 case 0x0B30:
211 case 0x0B31:
212 case 0x0B32:
213 case 0x0B33:
214 case 0x0B4E:
215 case 0x0B4F:
216 case 0x0B50:
217 case 0x0B51:
218 case 0x0B52:
219 case 0x0B53:
220 case 0x0B54:
221 case 0x0B55:
222 case 0x0B56:
223 case 0x0B57:
224 case 0x0B58:
225 case 0x0B59:
226 case 0x0B5A:
227 case 0x0B5B:
228 case 0x0B5C:
229 case 0x0B5D:

Callers 2

DrawCharacterMethod · 0.80
CharacterPixelsInXYMethod · 0.80

Calls 2

GetZMethod · 0.80
IsStaticGroupObjectMethod · 0.45

Tested by

no test coverage detected