comparison Actor.cpp @ 1863:97b75e6100ff

Actor::Explode cleaned up
author Grumpy7
date Mon, 14 Oct 2013 07:40:44 +0200
parents a2bdc17ffd2f
children b6258f64e313
comparison
equal deleted inserted replaced
1862:a2bdc17ffd2f 1863:97b75e6100ff
903 } 903 }
904 return; 904 return;
905 } 905 }
906 906
907 //----- (00404736) -------------------------------------------------------- 907 //----- (00404736) --------------------------------------------------------
908 signed int __fastcall Actor::Explode(unsigned int uActorID) 908 void Actor::Explode( unsigned int uActorID )
909 { 909 {
910 Actor *v1; // esi@1 910 Actor *v1; // esi@1
911 signed int v2; // edx@1
912 char *v3; // ecx@2
913 unsigned __int16 v4; // ax@5
914 int v5; // ebx@6
915 int v6; // ecx@6
916 //int v7; // eax@6
917 SpriteObject a1; // [sp+Ch] [bp-78h]@1 911 SpriteObject a1; // [sp+Ch] [bp-78h]@1
918 unsigned int v10; // [sp+7Ch] [bp-8h]@1 912
919 int v11; // [sp+80h] [bp-4h]@6
920
921 v10 = uActorID;
922 v1 = &pActors[uActorID]; 913 v1 = &pActors[uActorID];
923 v2 = 0;
924 a1.uType = 600; 914 a1.uType = 600;
925 if ( (signed int)pObjectList->uNumObjects <= 0 ) 915 a1.uObjectDescID = GetObjDescId(a1.uType);
926 {
927 LABEL_5:
928 v4 = 0;
929 }
930 else
931 {
932 v3 = (char *)&pObjectList->pObjects->uObjectID;
933 while ( *(short *)v3 != 600 )
934 {
935 ++v2;
936 v3 += 56;
937 if ( v2 >= (signed int)pObjectList->uNumObjects )
938 goto LABEL_5;
939 }
940 v4 = v2;
941 }
942 a1.uObjectDescID = v4;
943 a1.stru_24.Reset(); 916 a1.stru_24.Reset();
944 a1.vPosition.y = v1->vPosition.y; 917 a1.vPosition.y = v1->vPosition.y;
945 a1.spell_id = 0; 918 a1.spell_id = 0;
946 v5 = v1->vPosition.x;
947 v11 = v1->uActorHeight;
948 a1.spell_level = 0; 919 a1.spell_level = 0;
949 a1.spell_skill = 0; 920 a1.spell_skill = 0;
950 a1.vPosition.x = v5; 921 a1.vPosition.x = v1->vPosition.x;
951 v6 = v1->vPosition.z - (unsigned int)(signed __int64)((double)v11 * -0.75);
952 a1.uFacing = 0; 922 a1.uFacing = 0;
953 a1.vPosition.z = v6; 923 a1.vPosition.z = v1->vPosition.z - (unsigned int)(v1->uActorHeight * -0.75);
954 a1.uSoundID = 0; 924 a1.uSoundID = 0;
955 a1.uAttributes = 0; 925 a1.uAttributes = 0;
956 a1.uSectorID = pIndoor->GetSector(v5, a1.vPosition.y, v6); 926 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z);
957 a1.uSpriteFrameID = 0; 927 a1.uSpriteFrameID = 0;
958 a1.spell_caster_pid = PID(OBJECT_Actor, v10); 928 a1.spell_caster_pid = PID(OBJECT_Actor, uActorID);
959 a1.spell_target_pid = 0; 929 a1.spell_target_pid = 0;
960 a1.field_60_distance_related_prolly_lod = 3; 930 a1.field_60_distance_related_prolly_lod = 3;
961 a1.field_61 = 4; 931 a1.field_61 = 4;
962 return a1.Create(0, 0, 0, 0); 932 a1.Create(0, 0, 0, 0);
933 return;
963 } 934 }
964 935
965 //----- (004040E9) -------------------------------------------------------- 936 //----- (004040E9) --------------------------------------------------------
966 // // Get direction vector from object1 to object2, 937 // // Get direction vector from object1 to object2,
967 // // distance from object1 to object2 and Euler angles of the direction vector 938 // // distance from object1 to object2 and Euler angles of the direction vector