Fix Training not showing in barns.

Fix Crash on invalid ranch loading
Add "Player here" click message.
This commit is contained in:
SilicaAndPina 2021-02-12 21:47:42 +13:00
parent 2d2d6235e3
commit afc232352d
6 changed files with 34 additions and 2 deletions

View file

@ -12,6 +12,9 @@ namespace HISP.Game
// Mod isle
public static string ModIsleMessage;
// Click
public static string PlayerHereFormat;
// Ranch
public static string RanchUnownedRanchFormat;
public static string RanchYouCouldPurchaseThisRanch;
@ -682,6 +685,11 @@ namespace HISP.Game
public static string NothingInterestingHere;
public static string FormatPlayerHereMessage(string playerName)
{
return PlayerHereFormat.Replace("%USERNAME%", playerName);
}
// Farrier Formats
public static string FormatFarrierPutOnSteelShoesAllMesssage(int curShoes, int maxShoes)
{

View file

@ -1197,6 +1197,13 @@ namespace HISP.Game
{
string message = "";
if(!Ranch.RanchExists(ranchId)) // Ghost ranchs exist.. apparently?
{
user.MetaPriority = false;
return BuildMetaInfo(user, user.X, user.Y);
}
Ranch ranch = Ranch.GetRanchById(ranchId);
bool mine = (ranch.OwnerId == user.Id);
string swfModule = ranch.GetSwf(mine);

View file

@ -405,6 +405,15 @@ namespace HISP.Game
}
return false;
}
public static bool RanchExists(int ranchId)
{
foreach (Ranch ranch in Ranches)
{
if (ranch.Id == ranchId)
return true;
}
return false;
}
public static Ranch GetRanchById(int ranchId)
{
foreach (Ranch ranch in Ranches)