fix: Fixes respawn command when spawner is off (#1891)
This commit is contained in:
parent
4a83b651f4
commit
4610712205
4 changed files with 5 additions and 4 deletions
|
|
@ -61,6 +61,7 @@ public interface ISpawner : IEntity
|
|||
int HomeRange { get; }
|
||||
Region Region { get; }
|
||||
bool ReturnOnDeactivate { get; }
|
||||
bool Running { get; }
|
||||
|
||||
void Remove(ISpawnable spawn);
|
||||
Point3D GetSpawnPosition(ISpawnable spawned, Map map);
|
||||
|
|
|
|||
|
|
@ -575,9 +575,9 @@ public class AdvancedSearchGump : Gump
|
|||
{
|
||||
var entry = SearchResults[i];
|
||||
|
||||
if (entry.Selected)
|
||||
if (entry.Selected && entry.Entity is ISpawner { Running: true } spawner)
|
||||
{
|
||||
(entry.Entity as Spawner)?.Respawn();
|
||||
spawner.Respawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class RespawnCommand : BaseCommand
|
|||
|
||||
foreach (var obj in list)
|
||||
{
|
||||
if (obj is ISpawner spawner)
|
||||
if (obj is ISpawner { Running: true } spawner)
|
||||
{
|
||||
spawner.Respawn();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ public partial class ProximitySpawner : Spawner
|
|||
|
||||
public override string DefaultName => "Proximity Spawner";
|
||||
|
||||
public override bool HandlesOnMovement => true;
|
||||
public override bool HandlesOnMovement => Running;
|
||||
|
||||
public override void ToJson(DynamicJson json, JsonSerializerOptions options)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue