[Help] 5095 Guards & Revive Problem.

10/04/2010 00:22 killersub#1
okay so I am fixing this coemu 5095 base (released from andyd) and added a ton of features and bug fixes to it...that's okay cuz its not the problem. but now I'm trying everything but when I walk for about 5 seconds a the guards continually kill me and kill me over and over again...I changed all the names in the source and in navicat my sql but still nothing...

Guards Error:

Code:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
                         at System.Collections.Generic.Dictionary'2.get_Item<Tkey key>
at CoEmuV2.GameServer.Entities.Monster.AttackMove<Int32 Target, Boolean First> in Monster.cs line 840
And what I have in that line is this code(the error is in red):

Code:
if (this.Info.Name != "Watcher1")
                        {
                            if (this.Info.Name != "Watcher1")
                            {
                                [COLOR="Red"]DMap DMap = Nano.DMaps[Map];[/COLOR]
                                if (!DMap[X + AddX, Y + AddY, DMapObjectType.MOB])
                                {
                                    trys++;
                                    if (trys < 2)
                                    { ToDir = (byte)Nano.Rand.Next(1, 7); goto Go; }
                                    Move = null;
                                    Moving = false;
                                    return;
                                }
                                else
                                {
                                    if (Handler.PlaceFree(Map, X, Y, ToDir))
                                    {
                                        X += AddX;
                                        Y += AddY;
                                        ConquerPacket.ToLocal(ConquerPacket.Walk(ToDir, UID), X, Y, Map, 0, 0);
                                        Move.Start();
                                    }
                                    else
                                    {
                                        trys2++;
                                        if (trys2 < 2)
                                        { ToDir = (byte)Nano.Rand.Next(1, 7); goto Go; }
                                        Move = null;
                                        Moving = false;
                                        return;
                                    }
                                }
                            }
                        }
                    }
any ideas??? Help would be appreciated!
10/04/2010 02:37 _tao4229_#2
Try debugging it and see if the map is actually valid.

(Click to the left of the line on the gray margin - a red dot should appear and the line should be highlighted in red. Then debug (f5) the server and do what is causing the bug. The server should freeze and now switch back to visual studio and the line should be highlighted yellow. Hold your cursor over [Map] and see what the value of Map is. Post it here/look up to see if its valid. If it isn't valid - find the source of setting an invalid map. If it is valid, you're not loading the dmap for said valid map).
10/04/2010 22:24 killersub#3
Quote:
Originally Posted by _tao4229_ View Post
Try debugging it and see if the map is actually valid.

(Click to the left of the line on the gray margin - a red dot should appear and the line should be highlighted in red. Then debug (f5) the server and do what is causing the bug. The server should freeze and now switch back to visual studio and the line should be highlighted yellow. Hold your cursor over [Map] and see what the value of Map is. Post it here/look up to see if its valid. If it isn't valid - find the source of setting an invalid map. If it is valid, you're not loading the dmap for said valid map).
haha thanks buddy boy, I didn't really have time to fix the source so I just asked. I fixed my problem anyways.

#request close