mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
Fixed crash in the Twin Valkyrs encounter in ToC. closes #4915
This commit is contained in:
@@ -562,11 +562,13 @@ struct mob_unleashed_ballAI : public ScriptedAI
|
||||
{
|
||||
float x0 = ToCCommonLoc[1].GetPositionX(), y0 = ToCCommonLoc[1].GetPositionY(), r = 47.0f;
|
||||
float y = y0;
|
||||
float x = float(urand(uint32(x0 - r), uint32(x0 + r)));
|
||||
float x = frand(x0 - r, x0 + r);
|
||||
float sq = pow(r, 2) - pow(x - x0, 2);
|
||||
float rt = sqrtf(fabs(sq));
|
||||
if (urand(0, 1))
|
||||
y = y0 + sqrt(pow(r, 2) - pow((x-x0), 2));
|
||||
y = y0 + rt;
|
||||
else
|
||||
y = y0 - sqrt(pow(r, 2) - pow((x-x0), 2));
|
||||
y = y0 - rt;
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, me->GetPositionZ());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user