Skip to content

Commit

Permalink
Tracker fixes (#193)
Browse files Browse the repository at this point in the history
* Fix for latest optimalization

* version up

* Fixes...

Co-authored-by: Hazzer <[email protected]>
  • Loading branch information
Hazzer and Hazzer authored Jun 21, 2020
1 parent c6c57c0 commit 7fde629
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</li>
</modDependencies>

<description>Version 1.1.8
<description>Version 1.1.9

This mod force prisoners to work. To enable this feature prisoners must have "Force to work" option checked ("Prisoner" tab). Prison labor needs management that consist:
- Motivation - prisoners need to be motivated by presence of colonists. Wardens have new job - supervising prisoners. Low motivation can lead to revolts.
Expand Down
Binary file modified Assemblies/PrisonLabor.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>
<p align="center">
<a href="https://github.com/Aviuz/PrisonLabor/releases">
<img src="https://img.shields.io/badge/version-1.1.8-orange.svg?style=flat" alt="v1.1.8" />
<img src="https://img.shields.io/badge/version-1.1.9-orange.svg?style=flat" alt="v1.1.9" />
</a>
</p>

Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Meta/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public enum Version
v1_1_5,
v1_1_6,
v1_1_7,
v1_1_8
v1_1_8,
v1_1_9
}
}
4 changes: 2 additions & 2 deletions Source/Core/Meta/VersionUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace PrisonLabor.Core.Meta
{
class VersionUtility
{
public const Version versionNumber = Version.v1_1_8;
public const string versionString = "1.1.8";
public const Version versionNumber = Version.v1_1_9;
public const string versionString = "1.1.9";

public static Version VersionOfSaveFile { get; set; }

Expand Down
9 changes: 7 additions & 2 deletions Source/Core/Trackers/InspirationTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public static void Calculate(Map map)

foreach (var warden in wardens)
{
if(warden.GetRoom() == null)
{
continue;
}

var roomId = warden.GetRoom().ID;

if (!roomsIdtoWardens.ContainsKey(roomId))
Expand All @@ -106,11 +111,11 @@ public static void Calculate(Map map)

foreach (var prisoner in prisoners)
{
var roomId = prisoner.GetRoom().ID;
if (!roomsIdtoWardens.ContainsKey(roomId))
if (prisoner.GetRoom() == null || !roomsIdtoWardens.ContainsKey(prisoner.GetRoom().ID))
{
continue;
}
var roomId = prisoner.GetRoom().ID;

foreach (var warden in roomsIdtoWardens[roomId])
{
Expand Down
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Changelog:
1.1.9
- NPR fix for previus optimization
1.1.8
- Turn on/off prisoner suicide should work now
- Performance optimization (https://github.com/kbatbouta)
Expand Down

0 comments on commit 7fde629

Please sign in to comment.