Skip to content

[Bug] Multiple EMPs (StunDurations) overwrite each other #161

Description

@Templarfreak

OpenTS version

0.1.0 (1985c39)

What happened?

Each location StunDuration is set to is not guarded in pretty much any way. This means if a different EMP hits something already EMP'd with a significantly shorter stun duration, it totally overwrites it with that shorter stun duration, meaning a longer EMP is cancelled out.

foot->StunDuration = Duration;

here the only thing guarding setting to the duration here really is (Duration + CreationFrame > Frame) at the top of the function, which pretty much just ensures too short of durations or negative durations are not possible. if that condition is satisfied, a StunDuration is pretty much always set for all targets that can be affected.

other places its set to:

OpenTS/code/empulse.cpp

Lines 181 to 182 in 1985c39

building->StunDuration = Duration;
if (building->Class->IsRadar) {

foot->StunDuration = Duration;

Environment

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions