Mercurial > mm7
comparison Actor.cpp @ 1886:df873a01767a
Actor::AI_Pursue2 cleaned up
author | Grumpy7 |
---|---|
date | Sat, 19 Oct 2013 07:56:16 +0200 |
parents | 70719fa68500 |
children | 25655815623a |
comparison
equal
deleted
inserted
replaced
1885:70719fa68500 | 1886:df873a01767a |
---|---|
2232 } | 2232 } |
2233 | 2233 |
2234 //----- (0040281C) -------------------------------------------------------- | 2234 //----- (0040281C) -------------------------------------------------------- |
2235 void Actor::AI_Pursue2(unsigned int uActorID, unsigned int a2, signed int uActionLength, AIDirection *pDir, int a5) | 2235 void Actor::AI_Pursue2(unsigned int uActorID, unsigned int a2, signed int uActionLength, AIDirection *pDir, int a5) |
2236 { | 2236 { |
2237 unsigned int v5; // edi@1 | |
2238 int v6; // eax@1 | 2237 int v6; // eax@1 |
2239 Actor *v7; // ebx@1 | 2238 Actor *v7; // ebx@1 |
2240 unsigned int v8; // ecx@1 | 2239 unsigned int v8; // ecx@1 |
2241 char v9; // zf@1 | |
2242 AIDirection *v10; // esi@7 | 2240 AIDirection *v10; // esi@7 |
2243 signed int v11; // edx@12 | |
2244 signed __int16 v13; // cx@19 | 2241 signed __int16 v13; // cx@19 |
2245 unsigned __int16 v14; // ax@25 | 2242 unsigned __int16 v14; // ax@25 |
2246 int v15; // [sp-8h] [bp-54h]@12 | |
2247 AIDirection *v16; // [sp-4h] [bp-50h]@12 | |
2248 AIDirection a3; // [sp+Ch] [bp-40h]@8 | 2243 AIDirection a3; // [sp+Ch] [bp-40h]@8 |
2249 AIDirection v18; // [sp+28h] [bp-24h]@8 | 2244 AIDirection v18; // [sp+28h] [bp-24h]@8 |
2250 unsigned int v19; // [sp+44h] [bp-8h]@1 | 2245 |
2251 unsigned int v20; // [sp+48h] [bp-4h]@1 | |
2252 | |
2253 v5 = uActorID; | |
2254 v6 = 0; | 2246 v6 = 0; |
2255 v7 = &pActors[uActorID]; | 2247 v7 = &pActors[uActorID]; |
2256 v19 = a2; | |
2257 v8 = PID(OBJECT_Actor,uActorID); | 2248 v8 = PID(OBJECT_Actor,uActorID); |
2258 v9 = v7->pMonsterInfo.uFlying == 0; | 2249 if ( v7->pMonsterInfo.uFlying != 0 && !pParty->bFlying ) |
2259 v20 = v5; | |
2260 if ( !v9 && !pParty->bFlying ) | |
2261 { | 2250 { |
2262 if ( v7->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor ) | 2251 if ( v7->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor ) |
2263 v6 = v7->uActorRadius + 512; | 2252 v6 = v7->uActorRadius + 512; |
2264 else | 2253 else |
2265 v6 = pParty->uPartyHeight; | 2254 v6 = pParty->uPartyHeight; |
2266 } | 2255 } |
2267 v10 = pDir; | 2256 v10 = pDir; |
2268 if ( !pDir ) | 2257 if ( !pDir ) |
2269 { | 2258 { |
2270 memcpy(&v18, Actor::GetDirectionInfo(v8, a2, &a3, v6), sizeof(v18)); | 2259 v10 = Actor::GetDirectionInfo(v8, a2, &a3, v6); |
2271 memcpy(0, &v18, 0x1Cu); | |
2272 v10 = 0; | |
2273 v5 = v20; | |
2274 } | 2260 } |
2275 if ( MonsterStats::BelongsToSupertype(v7->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) ) | 2261 if ( MonsterStats::BelongsToSupertype(v7->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) ) |
2276 { | 2262 { |
2277 if ( !uActionLength ) | 2263 if ( !uActionLength ) |
2278 uActionLength = 256; | 2264 uActionLength = 256; |
2279 v16 = v10; | 2265 Actor::AI_StandOrBored(uActorID, 4, uActionLength, v10); |
2280 v15 = uActionLength; | |
2281 v11 = 4; | |
2282 Actor::AI_StandOrBored(v5, v11, v15, v16); | |
2283 return; | 2266 return; |
2284 } | 2267 } |
2285 if ( (signed int)v10->uDistance < a5 ) | 2268 if ( (signed int)v10->uDistance < a5 ) |
2286 { | 2269 { |
2287 if ( !uActionLength ) | 2270 if ( !uActionLength ) |
2288 uActionLength = 256; | 2271 uActionLength = 256; |
2289 v11 = v19; | 2272 Actor::AI_StandOrBored(uActorID, a2, uActionLength, v10); |
2290 v16 = v10; | |
2291 v15 = uActionLength; | |
2292 Actor::AI_StandOrBored(v5, v11, v15, v16); | |
2293 return; | 2273 return; |
2294 } | 2274 } |
2295 if ( uActionLength ) | 2275 if ( uActionLength ) |
2296 { | 2276 { |
2297 v7->uCurrentActionLength = uActionLength; | 2277 v7->uCurrentActionLength = uActionLength; |