Skip to content

Commit

Permalink
Fix NPE, fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Apr 11, 2022
1 parent 0eb5310 commit 0e207f7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CheatMachineRemoteDeposit/CheatMachineRemoteDeposit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net462</TargetFramework>
<AssemblyName>CheatMachineRemoteDeposit</AssemblyName>
<Description>(Cheat) Machines Deposit Into Remote Containers</Description>
<Version>1.0.0.0</Version>
<Version>1.0.0.1</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<Platforms>AnyCPU</Platforms>
Expand Down
10 changes: 5 additions & 5 deletions CheatMachineRemoteDeposit/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace CheatMachineRemoteDeposit
{
[BepInPlugin("akarnokd.theplanetcraftermods.cheatmachineremotedeposit", "(Cheat) Machines Deposit Into Remote Containers", "1.0.0.0")]
[BepInPlugin("akarnokd.theplanetcraftermods.cheatmachineremotedeposit", "(Cheat) Machines Deposit Into Remote Containers", "1.0.0.1")]
public class Plugin : BaseUnityPlugin
{

Expand All @@ -33,13 +33,13 @@ static bool MachineGenerator_GenerateAnObject(Inventory ___inventory, List<Group
string gid = "*" + worldObject.GetGroup().GetId().ToLower();
foreach (WorldObject wo2 in WorldObjectsHandler.GetAllWorldObjects())
{
if (wo2.HasLinkedInventory())
if (wo2 != null && wo2.HasLinkedInventory())
{
Inventory inv2 = InventoriesHandler.GetInventoryById(wo2.GetLinkedInventoryId());
if (!inv2.IsFull())
if (inv2 != null && !inv2.IsFull())
{
string txt = wo2.GetText().ToLower();
if (txt.Contains(gid))
string txt = wo2.GetText();
if (txt != null && txt.ToLower().Contains(gid))
{
inventory = inv2;
break;
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ Note that some
resources are out of bounds and are not normally player-reachable. You may also
fall to your death so be careful on permadeath!

### Configuration

`akarnokd.theplanetcraftermods.cheatteleportnearestminable.cfg`

```
[General]
## List of comma-separated resource ids to look for.
# Setting type: String
# Default value: Cobalt,Silicon,Iron,ice,Magnesium,Titanium,Aluminium,Uranim,Iridium,Alloy,Zeolite,Osmium,Sulfur
ResourceSet = Cobalt,Silicon,Iron,ice,Magnesium,Titanium,Aluminium,Uranim,Iridium,Alloy,Zeolite,Osmium,Sulfur
```

## (Cheat) Minimap

Display a minimap on the lower left side of the screen.
Expand Down Expand Up @@ -158,20 +171,6 @@ MapSize = 400
ZoomLevel = 4
```

### Configuration

`akarnokd.theplanetcraftermods.cheatteleportnearestminable.cfg`

```
[General]
## List of comma-separated resource ids to look for.
# Setting type: String
# Default value: Cobalt,Silicon,Iron,ice,Magnesium,Titanium,Aluminium,Uranim,Iridium,Alloy,Zeolite,Osmium,Sulfur
ResourceSet = Cobalt,Silicon,Iron,ice,Magnesium,Titanium,Aluminium,Uranim,Iridium,Alloy,Zeolite,Osmium,Sulfur
```


## (Perf) Load Inventories Faster

This speeds up loading the game when there are lots of containers or (modded) containers have a lot of items.
Expand Down

0 comments on commit 0e207f7

Please sign in to comment.