Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix for #14719, No more lag on Adrenaline Rush. #14727

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
3 participants
@Malkeus
Copy link
Contributor

commented Jan 5, 2016

Fixes #14719. Adrenaline CBM and Adrenaline Injector spent 1 turn causing Adrenaline Comedown before becoming Adrenaline Rush, leading to unexpected delays upon activation.
The default intensity is 0, but the duration given requires intensity 2, leading to the 1 turn lag and a debug message.
Mycus Wrath suffered from the same error, this is corrected as well. There may be more effects with this error, I will look into it.

edit: Came at this from the wrong end of things, will try again when I get home in a few hours.

Fixes #14719. Adrenaline CBM and Adrenaline Injector spent 1 turn on …
…causing Adrenaline Comedown before becoming Adrenaline Rush, leading to unexpected delays upon activation.

The default intensity is 0, but the duration given requires intensity 2, leading to the 1 turn lag and a debug message.
Mycus Wrath suffered from the same error, this is corrected as well. There may be more effects with this error, I will look into it.
@Malkeus

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2016

Using smartgit leads to unexpected weirdness...oh well, at least my first attempt to push from my pc to my repository and PR to cleverraven succeeded.

@evilexecutive

This comment has been minimized.

Copy link
Contributor

commented Jan 5, 2016

You're a godsend to high-level survivors everywhere.

@Malkeus

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2016

Thanks for pointing it out in the forums. Do you know of anymore effects like this? It seems like nothing sets the intensity, so it's all suspect right now, since the default is 0.

@i2amroy

This comment has been minimized.

Copy link
Member

commented Jan 5, 2016

While this does fix the problem, it's not the best way to go about it. Instead we should just add a check for the effects of "int_dur_factor" as part of Creature::add_effect(). That would guarantee that effects apply directly at the correct intensity, without requiring changes to the application code that shouldn't be intended.

Basically you want to take this logic from decay() in effect.cpp:

    if (eff_type->int_dur_factor != 0) {
        // + 1 here so that the lowest is intensity 1, not 0
        intensity = (duration / eff_type->int_dur_factor) + 1;
    }

and insert it into the proper locations in Creature::add_effect().

@Malkeus

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2016

so, before the bit that triggers the debug message and sets intensity to 1, there should be a check. I'll work out what this means when I get back home to my PC. This would make it unnecessary to mess with other effects as well, and I'm all for that. I figured this wasn't the best way to handle it, but I'm not a subtle guy...Thanks for pointing me in the correct direction. I'll do better.

@Malkeus Malkeus changed the title Fix for #14719, No more lag on Adrenaline Rush. [WIP] Fix for #14719, No more lag on Adrenaline Rush. Jan 6, 2016

@Malkeus Malkeus closed this Jan 6, 2016

@Malkeus Malkeus deleted the Malkeus:AdrenalineFix branch Jan 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.