public void SendActorToMap(Actor mActor, Map newMap, short x, short y) { // todo: add support for multiple map servers // obtain the new map byte mapid = (byte)newMap.id; if (mapid == mActor.MapID) { TeleportActor(mActor, x, y); return; } // delete the actor from this map this.DeleteActor(mActor); // update the actor mActor.MapID = mapid; mActor.X = x; mActor.Y = y; // register the actor in the new map if (mActor.type != ActorType.PC) { newMap.RegisterActor(mActor); } else { newMap.RegisterActor(mActor, mActor.ActorID); } }
public void SendActorToMap(Actor mActor, Map newMap, float x, float y, float z) { // todo: add support for multiple map servers // obtain the new map byte mapid = (byte)newMap.id; if (mapid == mActor.mapID) { TeleportActor(mActor, x, y, z); return; } // delete the actor from this map this.DeleteActor(mActor); // update the actor mActor.mapID = mapid; mActor.x = x; mActor.y = y; mActor.z = z; ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)mActor.e; eh.C.map = newMap; // register the actor in the new map if (mActor.type != ActorType.PC) { newMap.RegisterActor(mActor); } else { newMap.RegisterActor(mActor, mActor.id); } }