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

[Bug]: Condition light with light level < 1 and >=0 will crash server #4782

Open
4 tasks done
Feeltz opened this issue Sep 10, 2024 · 0 comments
Open
4 tasks done

[Bug]: Condition light with light level < 1 and >=0 will crash server #4782

Feeltz opened this issue Sep 10, 2024 · 0 comments
Labels
bug An issue describing unexpected behavior of code needs-confirmation not confirmed by a developer yet

Comments

@Feeltz
Copy link

Feeltz commented Sep 10, 2024

By submitting this bug issue, you agree to the following.

  • This is a bug in the software that resides in this repository, and not a support matter (use https://otland.net/forums/support.16/ for support)
  • This issue is reproducible without changes to the C++ code in this repository
  • This bug has not been resolved in master branch
  • There is no existing issue for this bug already

Does this bug crash tfs?

yes

Server Version

1.7 (Master) 1.4.2 and others

Operation System

Windows, Ubuntu 20.04, Ubuntu 22.04

Bug description

Server crashes with condition light that has level set to 0

Possible Pull Requests which are to blame

No response

Steps to reproduce

  1. Create Light Condition
  2. Set CONDITION_PARAM_LIGHT_LEVEL param to value >= 0 and < 1
  3. add condition to player
    Code to reproduce the issue:
local condition = Condition(CONDITION_LIGHT)
condition:setParameter(CONDITION_PARAM_LIGHT_COLOR, 215)
condition:setParameter(CONDITION_PARAM_TICKS, 10000)
condition:setParameter(CONDITION_PARAM_LIGHT_LEVEL, 0.2)
player:addCondition(condition)

It will crash at:

lightChangeInterval = ticks / lightInfo.level;

because of division by 0

Actual Behavior

Server crashes

Expected Behavior

Server do not crash ^^
maybe warning on setting condition param?

Backtrace

No response

@Feeltz Feeltz added bug An issue describing unexpected behavior of code needs-confirmation not confirmed by a developer yet labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue describing unexpected behavior of code needs-confirmation not confirmed by a developer yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant