Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Work loop error !!! #1056

Open
hsw138 opened this issue Feb 23, 2025 · 0 comments
Open

A Work loop error !!! #1056

hsw138 opened this issue Feb 23, 2025 · 0 comments

Comments

@hsw138
Copy link

hsw138 commented Feb 23, 2025

In the REDCAVE01 map, use the mage profession to summon heroes, adjust the attack mode to all, first use the magic shield, then quickly consume 2 bottles of HP potion in Beltcell around the monster, and continuously use the skill FlameField. Repeating this operation will cause the server to crash, resulting in an error:
[Work loop error Thread 1342]System.NullReferenceException: Object reference not set to an instance of an object.
at Server.MirEnvir.Map.CompleteMagic(IList`1 data) in E:\legend\mir2-main\Server\MirEnvir\Map.cs:line 1342
at Server.MirEnvir.Map.Process(DelayedAction action) in E:\legend\mir2-main\Server\MirEnvir\Map.cs:line 820
at Server.MirEnvir.Map.Process() in E:\legend\mir2-main\Server\MirEnvir\Map.cs:line 759
at Server.MirEnvir.Envir.WorkLoop() in E:\legend\mir2-main\Server\MirEnvir\Envir.cs:line 651
The error code is:# region ThunderStorm
case Spell.ThunderStorm:
case Spell.FlameField:
case Spell.NapalmShot:
//case Spell. StormEscape:
value = (int)data[2];
location = (Point)data[3];
for (int y = location.Y - 2; y <= location.Y + 2; y++)
{
if (y < 0) continue;
if (y >= Height) break;
for (int x = location.X - 2; x <= location.X + 2; x++)
{
if (x < 0) continue;
if (x >= Width) break;
cell = GetCell(x, y);
if (!cell.Valid || cell.Objects == null) continue;
for (int i = 0; i < cell.Objects.Count; i++) //
{
MapObject target = cell.Objects[i];
switch (target.Race)
{
case ObjectType.Monster:
case ObjectType.Player:
//Only targets
if (!target.IsAttackTarget(player)) break;
target.Attacked(player, magic.Spell == Spell.ThunderStorm && !target.Undead ? value / 10 : value, DefenceType.MAC, false);
train = true;
break;
}
}
}
}
break;
#endregion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant