Fixes ServerPortalComponent spamming exceptions and crashing server if spawned manually.

Also makes the prototype abstract because it doesn't work straight up.
This commit is contained in:
Pieter-Jan Briers
2020-05-28 20:09:14 +02:00
parent 94917a63a6
commit 718b37fb2c
2 changed files with 19 additions and 17 deletions

View File

@@ -193,9 +193,11 @@ namespace Content.Server.GameObjects.Components.Movement
public void TryPortalEntity(IEntity entity)
{
if (!immuneEntities.Contains(entity))
if (immuneEntities.Contains(entity) || _connectingTeleporter == null)
{
return;
}
var position = _connectingTeleporter.Transform.GridPosition;
var soundPlayer = EntitySystem.Get<AudioSystem>();
@@ -214,4 +216,3 @@ namespace Content.Server.GameObjects.Components.Movement
}
}
}
}

View File

@@ -48,6 +48,7 @@
- type: entity
name: Portal
id: Portal
abstract: true
description: "Portal to another location"
components:
- type: Collidable