Skip to content

Commit

Permalink
Fixes Zaicon#6, Zaicon#10, and Zaicon#11, warning on InfMain.cs#L640,…
Browse files Browse the repository at this point in the history
… updates AssemblyInfo.cs to version 1.3.0.0, has my built files
  • Loading branch information
mpql committed Jun 3, 2020
1 parent 7b087f0 commit e203eeb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
15 changes: 9 additions & 6 deletions InfiniteChestsV3/InfMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ private void OnGetData(GetDataEventArgs args)
item.stack = stack;
item.prefix = prefix;

if (ciplayer.HasPermission(Permissions.spawnmob) && Main.hardMode && (item.netID == 3091 && (ciplayer.TPlayer.ZoneCrimson || ciplayer.TPlayer.ZoneCorrupt)))
if (ciplayer.HasPermission(Permissions.spawnmob) && Main.hardMode && (item.netID == 3092 || item.netID == 3091))
{
bool empty = true;
foreach (var initem in cichest.items)
Expand All @@ -388,15 +388,19 @@ private void OnGetData(GetDataEventArgs args)
NetMessage.SendData((int)PacketTypes.SyncPlayerChestIndex, -1, index, NetworkText.Empty, index, -1);
DB.DeleteChest(cichest.id);
WorldGen.KillTile(cichest.x, cichest.y, noItem: true);
TSPlayer.All.SendData(PacketTypes.Tile, null, 0, cichest.x, cichest.y + 1);
NetMessage.SendTileSquare(ciplayer.Index, cichest.x, cichest.y, 3);

int type;
var random = new Random(Guid.NewGuid().GetHashCode());
if (netid == 3092)
type = 475;
else if (netid == 3091 && ciplayer.TPlayer.ZoneCrimson)
type = 474;
else //if (netid == 3091 && ciplayer.TPlayer.ZoneCorrupt)
else if (netid == 3091 && ciplayer.TPlayer.ZoneCorrupt)
type = 473;
else
type = random.Next(473, 475); // Min value is inclusive, max value is exclusive, i.e. this means int [473,475)

var npc = TShock.Utils.GetNPCById(type);
TSPlayer.Server.SpawnNPC(npc.type, npc.FullName, 1, ciplayer.TileX, ciplayer.TileY, 10, 10);
Expand Down Expand Up @@ -633,8 +637,7 @@ private void ChestCMD(CommandArgs args)
help.Add("/chest refill <seconds>");
help.Add("/chest cancel");

int pageNumber;
if (!PaginationTools.TryParsePageNumber(args.Parameters, 1, args.Player, out pageNumber))
if (!PaginationTools.TryParsePageNumber(args.Parameters, 1, args.Player, out int pageNumber))
return;

PaginationTools.SendPage(args.Player, pageNumber, help, new PaginationTools.Settings() { HeaderFormat = "Chest Subcommands ({0}/{1}):", FooterFormat = "Type /chest help {0} for more." });
Expand Down Expand Up @@ -862,9 +865,9 @@ private async void ConvChestsAsync(CommandArgs args)
args.Player.SendErrorMessage("This command has already been run!");
return;
}
if (DB.GetCount() > 1000)
if (DB.GetCount() > 8000) // Max is 8000: https://terraria.gamepedia.com/Chests
{
args.Player.SendErrorMessage("There are more than 1000 chests in the database, which is more than the map can hold.");
args.Player.SendErrorMessage("There are more than 8000 chests in the database, which is more than the map can hold.");
return;
}
args.Player.SendInfoMessage("Restoring chests. Please wait...");
Expand Down
5 changes: 3 additions & 2 deletions InfiniteChestsV3/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0-mopquill.1")]
Binary file modified InfiniteChestsV3/bin/Release/InfiniteChestsV3.dll
Binary file not shown.
Binary file modified InfiniteChestsV3/bin/Release/InfiniteChestsV3.pdb
Binary file not shown.

0 comments on commit e203eeb

Please sign in to comment.