Exemplo n.º 1
0
 public static void warpCharacter(short x, short y, string name, byte isStructure, long id)
 {
     if (Game1.otherFarmers.ContainsKey(id))
     {
         if (Game1.otherFarmers[id].currentLocation == null)
         {
             Game1.otherFarmers[id]._tmpLocationName = name;
             return;
         }
         Game1.otherFarmers[id].currentLocation.farmers.Remove(Game1.otherFarmers[id]);
         Game1.otherFarmers[id].currentLocation = Game1.getLocationFromName(name, isStructure == 1);
         Game1.otherFarmers[id].position.X      = (float)((int)x * Game1.tileSize);
         Game1.otherFarmers[id].position.Y      = (float)((int)y * Game1.tileSize - Game1.tileSize / 2);
         GameLocation locationFromName = Game1.getLocationFromName(name, isStructure == 1);
         locationFromName.farmers.Add(Game1.otherFarmers[id]);
         if (locationFromName.farmers.Count.Equals(Game1.numberOfPlayers() - 1))
         {
             locationFromName.checkForEvents();
         }
     }
     if (Game1.IsServer)
     {
         MultiplayerUtility.broadcastFarmerWarp(x, y, name, isStructure == 1, id);
     }
 }