Unique artifacts (#859)
* unique artifacts * Update demiplane_keys.yml * shadow staff * fixes * rename solution * Update CP14UniqueLootSystem.cs * try fix * Update CP14UniqueLootSystem.cs
This commit is contained in:
@@ -61,17 +61,22 @@ public abstract partial class CP14SharedMagicSystem
|
||||
if (!CanCastSpell(action, performer))
|
||||
return;
|
||||
|
||||
// event may return an empty entity with id = 0, which causes bugs
|
||||
var _target = target;
|
||||
if (_target is not null && _target.Value.Id == 0)
|
||||
_target = null;
|
||||
|
||||
if (_doAfter.IsRunning(action.Comp.ActiveDoAfter))
|
||||
_doAfter.Cancel(action.Comp.ActiveDoAfter);
|
||||
else
|
||||
{
|
||||
if (TryStartDelayedAction(delayedEffect, doAfter, action, target, performer))
|
||||
if (TryStartDelayedAction(delayedEffect, doAfter, action, _target, performer))
|
||||
{
|
||||
var evStart = new CP14StartCastMagicEffectEvent(performer);
|
||||
RaiseLocalEvent(action, ref evStart);
|
||||
|
||||
var spellArgs =
|
||||
new CP14SpellEffectBaseArgs(performer, action.Comp.SpellStorage, target, worldTarget);
|
||||
new CP14SpellEffectBaseArgs(performer, action.Comp.SpellStorage, _target, worldTarget);
|
||||
|
||||
CastTelegraphy(action, spellArgs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user