Added allowInteractionEverywhere setting.

master
Droog71 2022-05-09 01:07:10 -04:00
parent 9d7d4ea97f
commit 05cddb09b9
1 changed files with 13 additions and 1 deletions

View File

@ -10,6 +10,7 @@ public class AreaProtection : FortressCraftMod
{
private bool showGUI = true;
private bool allowInteractionAtSpawn;
private bool allowInteractionEverywhere;
private Coroutine serverCoroutine;
private Vector3 playerPosition;
private Vector3 clientAreaPosition;
@ -85,6 +86,17 @@ public class AreaProtection : FortressCraftMod
Debug.Log("Area Protection Mod: Error loading settings file: " + e.Message);
}
}
if (entryName == "allowInteractionEverywhere")
{
try
{
allowInteractionEverywhere = bool.Parse(splitEntry[1]);
}
catch (Exception e)
{
Debug.Log("Area Protection Mod: Error loading settings file: " + e.Message);
}
}
}
}
}
@ -457,7 +469,7 @@ public class AreaProtection : FortressCraftMod
Vector2 spawn_pos = new Vector2(0, 0);
float spawnDistance = Vector2.Distance(clientPos2D, spawn_pos);
if (spawnDistance <= 250 && allowInteractionAtSpawn == true)
if (allowInteractionEverywhere || (spawnDistance <= 250 && allowInteractionAtSpawn))
{
interactionException = true;
}