fix: Fixes random 0 (#783)

This commit is contained in:
Kamron Batman 2021-09-14 22:40:07 -07:00 committed by GitHub
parent c5e35c9b69
commit 3ade2d5e73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -399,7 +399,8 @@ namespace Server.Mobiles
if (spell == null)
{
if (!m_Mobile.DisallowAllMoves && Utility.Random((int)m_Mobile.GetDistanceToSqrt(toDispel)) == 0)
var distance = (int)m_Mobile.GetDistanceToSqrt(toDispel);
if (!m_Mobile.DisallowAllMoves && distance > 0 && Utility.Random(distance) == 0)
{
spell = new TeleportSpell(m_Mobile);
}