Skip to content

[BUG]: Effects applied via code cannot be reapplied via item after expiration #363

@CCrous

Description

@CCrous

Before You Report

  • I have searched for existing reports of this bug, and this bug report is unique.

Version

game:14.2.5 labapi:1.1.4.2

Description

When applying certain effects via code or the RA panel (such as Scp1344, Poisoned, or Invisibility), once the effect expires, the player is unable to receive the same effect again through the corresponding in-game item.

Observed behavior:

  • After the effect duration ends, the player no longer visibly has the effect.
  • However, internally:
    • Duration > 0
    • Intensity = 0
    • TimeLeft = 0
  • At this point, using the corresponding item (e.g., SCP-1344) does nothing.

In contrast, Scp207 does not have this issue.

Based on testing, Scp1344Item checks whether the effect is enabled and denies usage if it is considered active. Since the effect instance still exists (even though Intensity is 0), the item refuses to apply it again.

If Duration is manually set to 0 when Intensity == 0 (e.g., inside PlayerUpdatingEffect), the item works normally again.

This suggests that when the effect expires, it is not fully cleared or reset, causing the item logic to treat it as still present.

To Reproduce

Method 1: Vanilla (No Plugins)

  1. Start a clean server with no plugins and no Exiled.
  2. Use the RA panel to apply a short Scp1344 effect (e.g., 5 seconds).
  3. Wait until the effect naturally expires.
  4. Use the SCP-1344 item.
  5. The item produces no effect.

Method 2: Via Code

Player.EnableEffect(1, 5);

After 5 seconds:

  • Duration = 5
  • Intensity = 0
  • TimeLeft = 0

Using the SCP-1344 item still does nothing.

Temporary Workaround:

public override void OnPlayerUpdatingEffect(PlayerEffectUpdatingEventArgs ev)
{
    if (ev.Intensity == 0)
        ev.Duration = 0;
}

With this logic, the item can reapply the effect normally.

Expected Behavior

After the effect duration expires:

  • The effect should be fully removed, or
  • Duration should automatically reset to 0, or
  • The item should be allowed to reapply and refresh the effect.

In short, once the timed effect ends, the player should be able to receive the same effect again through the item without requiring plugin-side fixes.

Additional Information

https://discord.com/channels/330432627649544202/1476807512668901536

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingimportedImported to internal git

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions