mirror of
https://github.com/islehorse/HISP.git
synced 2025-06-20 09:45:19 +12:00
Fix crashing on talking to npcs with 0 chatpoints.
This commit is contained in:
parent
d776d2adc3
commit
fa8f21388c
8 changed files with 214 additions and 10 deletions
|
@ -236,6 +236,22 @@ namespace HISP.Game
|
|||
Database.SetRanchBuilding16(this.Id, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public string GetSwf(bool mine)
|
||||
{
|
||||
string swf = "ranchviewer.swf?H=" + upgradedLevel.ToString();
|
||||
for(int i = 0; i < buildings.Length; i++)
|
||||
{
|
||||
swf += "&B" + i.ToString() + "=";
|
||||
if (buildings[i] != null)
|
||||
{
|
||||
swf += buildings[i].Id.ToString();
|
||||
}
|
||||
}
|
||||
if (mine)
|
||||
swf += "&MINE=1";
|
||||
return swf;
|
||||
}
|
||||
|
||||
|
||||
public Ranch(int x, int y, int id, int value)
|
||||
|
@ -322,6 +338,15 @@ namespace HISP.Game
|
|||
}
|
||||
return false;
|
||||
}
|
||||
public static Ranch GetRanchById(int ranchId)
|
||||
{
|
||||
foreach (Ranch ranch in Ranches)
|
||||
{
|
||||
if (ranch.Id == ranchId)
|
||||
return ranch;
|
||||
}
|
||||
throw new KeyNotFoundException("No Ranch with id " + ranchId);
|
||||
}
|
||||
public static Ranch GetRanchAt(int x, int y)
|
||||
{
|
||||
foreach(Ranch ranch in Ranches)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue