mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-07 21:55:42 +12:00
fix crash
This commit is contained in:
parent
9272d71ca7
commit
6cec9249ab
2 changed files with 63 additions and 60 deletions
|
@ -1 +0,0 @@
|
|||
<Replaced with current git HEAD at compile time>
|
|
@ -1347,9 +1347,11 @@ namespace HISP.Server
|
|||
if (World.InSpecialTile(sender.LoggedinUser.X, sender.LoggedinUser.Y))
|
||||
{
|
||||
World.SpecialTile tile = World.GetSpecialTile(sender.LoggedinUser.X, sender.LoggedinUser.Y);
|
||||
if (tile.Code != null)
|
||||
{
|
||||
if (tile.Code.StartsWith("TRAINER-"))
|
||||
{
|
||||
if(trainHorseInst.TrainTimer > 0)
|
||||
if (trainHorseInst.TrainTimer > 0)
|
||||
{
|
||||
byte[] trainSuccessfulMessage = PacketBuilder.CreateChat(Messages.FormatTrainerCantTrainAgainIn(trainHorseInst.TrainTimer), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.SendPacket(trainSuccessfulMessage);
|
||||
|
@ -1360,7 +1362,7 @@ namespace HISP.Server
|
|||
|
||||
Trainer trainer = Trainer.GetTrainerById(trainerId);
|
||||
|
||||
if(sender.LoggedinUser.Money >= trainer.MoneyCost)
|
||||
if (sender.LoggedinUser.Money >= trainer.MoneyCost)
|
||||
{
|
||||
sender.LoggedinUser.TakeMoney(trainer.MoneyCost);
|
||||
trainHorseInst.BasicStats.Mood -= trainer.MoodCost;
|
||||
|
@ -1390,7 +1392,7 @@ namespace HISP.Server
|
|||
break;
|
||||
}
|
||||
trainHorseInst.BasicStats.Experience += trainer.ExperienceGained;
|
||||
if(sender.LoggedinUser.Subscribed)
|
||||
if (sender.LoggedinUser.Subscribed)
|
||||
trainHorseInst.TrainTimer = 1440;
|
||||
else
|
||||
trainHorseInst.TrainTimer = 720;
|
||||
|
@ -1415,6 +1417,8 @@ namespace HISP.Server
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue