Interaction Hotfix
Fixed exception when attempting to dock or enter wormhole
This commit is contained in:
parent
122e929214
commit
3f91b13d28
3 changed files with 12 additions and 6 deletions
|
|
@ -839,7 +839,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
{
|
||||
foreach (var entity in Zone.Entities.ToArray())
|
||||
{
|
||||
if (lengthsq(entity.Position.xz - CurrentEntity.Position.xz) <
|
||||
if (entity != CurrentEntity && lengthsq(entity.Position.xz - CurrentEntity.Position.xz) <
|
||||
Settings.GameplaySettings.DockingDistance * Settings.GameplaySettings.DockingDistance)
|
||||
{
|
||||
var bay = entity.TryDock(ship);
|
||||
|
|
|
|||
|
|
@ -288,9 +288,15 @@ public abstract class Entity
|
|||
}
|
||||
|
||||
// TODO: Inter-faction relationships
|
||||
public FactionRelationship GetFactionRelationship(Faction faction) =>
|
||||
this is Ship {IsPlayerShip: true} ? Zone.Sector.FactionRelationships[faction] : faction==Faction ? FactionRelationship.Beloved : FactionRelationship.Neutral;
|
||||
|
||||
public FactionRelationship GetFactionRelationship(Faction faction)
|
||||
{
|
||||
if (faction == null)
|
||||
return FactionRelationship.Neutral;
|
||||
if (this is Ship {IsPlayerShip: true})
|
||||
return Zone.Sector.FactionRelationships[faction];
|
||||
return faction.ID == Faction.ID ? FactionRelationship.Beloved : FactionRelationship.Neutral;
|
||||
}
|
||||
|
||||
public static bool IsPresencePermitted(FactionRelationship relationship, SecurityLevel securityLevel) =>
|
||||
(int) relationship - (int) securityLevel > 0;
|
||||
public static bool IsDockingPermitted(FactionRelationship relationship, SecurityLevel securityLevel) =>
|
||||
|
|
|
|||
BIN
GameData/PlayerSettings.msgpack
(Stored with Git LFS)
BIN
GameData/PlayerSettings.msgpack
(Stored with Git LFS)
Binary file not shown.
Loading…
Reference in a new issue