Mercurial > mm7
comparison Actor.cpp @ 1865:e622546c8f0c
Actor::AI_FaceObject cleanup
author | Grumpy7 |
---|---|
date | Mon, 14 Oct 2013 08:22:12 +0200 |
parents | b6258f64e313 |
children | 7a193504f18e |
comparison
equal
deleted
inserted
replaced
1864:b6258f64e313 | 1865:e622546c8f0c |
---|---|
1139 } | 1139 } |
1140 | 1140 |
1141 //----- (00404030) -------------------------------------------------------- | 1141 //----- (00404030) -------------------------------------------------------- |
1142 void Actor::AI_FaceObject(unsigned int uActorID, unsigned int uObjID, int _48, AIDirection *a4) | 1142 void Actor::AI_FaceObject(unsigned int uActorID, unsigned int uObjID, int _48, AIDirection *a4) |
1143 { | 1143 { |
1144 unsigned int v4; // edi@1 | |
1145 unsigned int v5; // esi@1 | |
1146 //unsigned int result; // eax@2 | |
1147 AIDirection *v7; // eax@3 | 1144 AIDirection *v7; // eax@3 |
1148 unsigned int v8; // ecx@3 | |
1149 Actor *v9; // ebx@3 | 1145 Actor *v9; // ebx@3 |
1150 AIDirection *v10; // esi@4 | |
1151 unsigned __int16 v11; // ax@5 | |
1152 AIDirection a3; // [sp+8h] [bp-38h]@4 | 1146 AIDirection a3; // [sp+8h] [bp-38h]@4 |
1153 AIDirection v13; // [sp+24h] [bp-1Ch]@4 | 1147 |
1154 | |
1155 v4 = uObjID; | |
1156 v5 = uActorID; | |
1157 if ( rand() % 100 >= 5 ) | 1148 if ( rand() % 100 >= 5 ) |
1158 { | 1149 { |
1159 v7 = a4; | 1150 v9 = &pActors[uActorID]; |
1160 v8 = 0; | |
1161 v9 = &pActors[v5]; | |
1162 if ( !a4 ) | 1151 if ( !a4 ) |
1163 { | 1152 { |
1164 v10 = Actor::GetDirectionInfo(PID(OBJECT_Actor, v5), v4, &a3, 0); | 1153 v7 = Actor::GetDirectionInfo(PID(OBJECT_Actor, uActorID), uObjID, &a3, 0); |
1165 v7 = &v13; | 1154 } |
1166 memcpy(&v13, v10, sizeof(v13)); | 1155 else |
1167 v8 = 0; | 1156 { |
1168 } | 1157 v7 = a4; |
1169 v9->uYawAngle = LOWORD(v7->uYawAngle); | 1158 } |
1170 v11 = LOWORD(v7->uPitchAngle); | 1159 v9->uYawAngle = v7->uYawAngle; |
1171 v9->uCurrentActionTime = v8; | 1160 v9->uCurrentActionTime = 0; |
1172 v9->vVelocity.z = v8; | 1161 v9->vVelocity.z = 0; |
1173 v9->vVelocity.y = v8; | 1162 v9->vVelocity.y = 0; |
1174 v9->vVelocity.x = v8; | 1163 v9->vVelocity.x = 0; |
1175 v9->uPitchAngle = v11; | 1164 v9->uPitchAngle = v7->uPitchAngle; |
1176 v9->uCurrentActionLength = 256; | 1165 v9->uCurrentActionLength = 256; |
1177 v9->uAIState = Interacting; | 1166 v9->uAIState = Interacting; |
1178 v9->UpdateAnimation(); | 1167 v9->UpdateAnimation(); |
1179 } | 1168 } |
1180 else | 1169 else |
1181 Actor::AI_Bored(v5, v4, a4); | 1170 Actor::AI_Bored(uActorID, uObjID, a4); |
1182 } | 1171 } |
1183 | 1172 |
1184 //----- (00403F58) -------------------------------------------------------- | 1173 //----- (00403F58) -------------------------------------------------------- |
1185 void Actor::AI_StandOrBored(unsigned int uActorID, signed int uObjID, int uActionLength, AIDirection *a4) | 1174 void Actor::AI_StandOrBored(unsigned int uActorID, signed int uObjID, int uActionLength, AIDirection *a4) |
1186 { | 1175 { |