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

Value of private variable '<variablename>' is never used in loops #65

Open
Hamster2k opened this issue Oct 23, 2024 · 0 comments
Open

Comments

@Hamster2k
Copy link

In my while loop, a variable shows up as never used, even though the value is used in the next iteration of the loop.

My code:

`waitUntil {
!isNil {
_this getVariable "bloodLevel"
}
};

_previousBloodLevel = _this getVariable "bloodLevel";

while { true } do {
if (_this getVariable "isVampire") exitWith {};

_currentBloodLevel = _this getVariable "bloodLevel";

if (_previousBloodLevel > 30 and _currentBloodLevel <= 30) then {
	"You feel weak." remoteExec ["hint", _this];
};

if (_previousBloodLevel <= 30 and _currentBloodLevel > 30) then {
	"You feel somewhat stronger." remoteExec ["hint", _this];
};

_previousBloodLevel = _currentBloodLevel;
_currentBloodLevel = _currentBloodLevel + 3;

if (_currentBloodLevel > 100) then {
	_currentBloodLevel = 100;
};

_this setVariable ["bloodLevel", _currentBloodLevel];

sleep 15;

}`

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant