fixed targeting (#1080)

This commit is contained in:
Nemoel-Tomo 2023-04-21 20:14:32 +02:00 committed by GitHub
parent 5c84d59f4e
commit 2b49e4edcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -327,9 +327,9 @@ namespace TEN::Entities::Creatures::TR5
GameVector eye = GameVector::Zero;
eye.RoomNumber = item->RoomNumber;
int cosX = MAX_VISIBILITY_DISTANCE * phd_cos(targetOrient.x);
eye.x = origin1.x + (cosX * phd_sin(item->Pose.Orientation.y));
int cosX = MAX_VISIBILITY_DISTANCE * phd_cos(targetOrient.x - ANGLE(23.45f));
eye.x = origin1.x + (cosX * phd_sin(item->Pose.Orientation.y ));
eye.y = origin1.y + (MAX_VISIBILITY_DISTANCE * phd_sin(-(targetOrient.x - GUARDIAN_ORIENT_OFFSET.x)));
eye.z = origin1.z + (cosX * phd_cos(item->Pose.Orientation.y));
@ -360,7 +360,7 @@ namespace TEN::Entities::Creatures::TR5
origin1.RoomNumber = item->RoomNumber;
guardian->LOS[i] = LOS(&origin1, &eye);
SpawnElectricity(origin1.ToVector3(), eye.ToVector3(), (GetRandomControl() & 1) + 3, color.x, color.y, color.z, 46, (int)ElectricityFlags::Spline | (int)ElectricityFlags::ThinIn | (int)ElectricityFlags::ThinOut, 6, 10);
guardian->fireArcs[i] = &ElectricityArcs.back();
guardian->fireArcs[i] = &ElectricityArcs.back();
StopSoundEffect(SFX_TR5_GOD_HEAD_CHARGE);
SoundEffect(SFX_TR5_GOD_HEAD_BLAST, &item->Pose);
}
@ -399,7 +399,7 @@ namespace TEN::Entities::Creatures::TR5
if (adx < 280 && ady < 280 && adz < 280)
farAway = 2;
Vector3i hitPos;
Vector3i hitPos = Vector3i::Zero;
MESH_INFO* hitMesh = nullptr;
GameVector start = GameVector(guardian->fireArcs[i]->pos1.x, guardian->fireArcs[i]->pos1.y, guardian->fireArcs[i]->pos1.z);