mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-05 21:55:42 +13:00
Fix Opening Present with ItemId 0
This commit is contained in:
parent
65dbd60f8c
commit
92643bf4e2
5 changed files with 11 additions and 5 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 85caa27ee931439d76003b5471a9dac906b491ba
|
||||
Subproject commit 35bf0e04a686990d7237326c048fd18b3a081aa5
|
|
@ -82,7 +82,7 @@ namespace HISP.Game.Chat
|
|||
}
|
||||
else
|
||||
{
|
||||
itemId = Item.GetRandomItem(false).Id;
|
||||
itemId = Item.GetRandomItem().Id;
|
||||
}
|
||||
|
||||
Item.GetItemById(itemId); // Calling this makes sure this item id exists.
|
||||
|
|
|
@ -478,7 +478,7 @@ namespace HISP.Game
|
|||
public static string SantaWrapItemFormat;
|
||||
public static string SantaWrappedObjectMessage;
|
||||
public static string SantaCantWrapInvFull;
|
||||
|
||||
public static string SantaCantOpenNothingInside;
|
||||
public static string SantaItemOpenedFormat;
|
||||
public static string SantaItemCantOpenInvFull;
|
||||
|
||||
|
|
|
@ -1558,7 +1558,7 @@ namespace HISP.Server
|
|||
Messages.SantaWrapItemFormat = gameData.messages.meta.santa.wrap_format;
|
||||
Messages.SantaWrappedObjectMessage = gameData.messages.meta.santa.wrapped_object;
|
||||
Messages.SantaCantWrapInvFull = gameData.messages.meta.santa.wrap_fail_inv_full;
|
||||
|
||||
Messages.SantaCantOpenNothingInside = gameData.messages.meta.santa.open_fail_empty;
|
||||
Messages.SantaItemOpenedFormat = gameData.messages.meta.santa.open_format;
|
||||
Messages.SantaItemCantOpenInvFull = gameData.messages.meta.santa.open_fail_inv_full;
|
||||
|
||||
|
|
|
@ -6455,8 +6455,14 @@ namespace HISP.Server
|
|||
int newItem = item.ItemInstances[0].Data;
|
||||
if(newItem == 0)
|
||||
{
|
||||
// TODO: Get "Present is empty" message.
|
||||
sender.LoggedinUser.Inventory.Remove(item.ItemInstances[0]);
|
||||
|
||||
byte[] itemOpenFailedNothingInside = PacketBuilder.CreateChat(Messages.SantaCantOpenNothingInside, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.SendPacket(itemOpenFailedNothingInside);
|
||||
|
||||
UpdateInventory(sender);
|
||||
|
||||
break;
|
||||
}
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue