Jump to content
Sycholic

Bad conversion: bool client spamming source?

Recommended Posts

Just wondering but I'm from mainly from java so seeing this message spammed 1700+ times over the course of a few hours clientside.  Could this be the possible source or using this method of assignment?

 

if (cfg_foo == 1) then {cfg_foo = true} else {cfg_foo = false};

 

foo is already a number or integer/float(cfg datatype and that is the case in this situation).  And that just made it a bool now...

Would it not be safer to do this and possibly less spammy, and log bloating...  (using -nolog should not be a solution)

 

if (cfg_foo == 1) then {foo_bool = true} else {foo_bool = false};

Share this post


Link to post
Share on other sites

It's good practice to have one variable stay within the same datatype.

You could also avoid if then like this:

foo_bool = cfg_foo == 1;

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Well to me that is common sense to me at least.

right now I am mainly wondering if arma might be crying over using the above method for the most part.

Share this post


Link to post
Share on other sites

Arma would not complain about a variable data Type change. It would when using a variable of incorrect data type in an incorrect setting.

Only way your original code could do that would be the == operator, aka cfg_foo isn't a scalar before the comparison. 

 

Since it's a spam I'm gonna guess it's in a loop somewhere. Do some log printouts to check which part of your code is generating it. To write to log use: diag_log 

Share this post


Link to post
Share on other sites
2 minutes ago, mrcurry said:

Arma would not complain about a variable data Type change. It would when using a variable of incorrect data type in an incorrect setting. Since it's a spam I'm gonna guess it's in a loop somewhere. Do some log printouts to check which part of your code is generating it. To write to log use: diag_log 

 

That is the issue it doesn't say at all where its happening.  the log file repeats nothing but "Bad conversion: bool"  it doesn't name where, or what or anything... to even remotely indicate where its happening

 

Share this post


Link to post
Share on other sites
1 minute ago, Sycholic said:

 

That is the issue it doesn't say at all where its happening.  the log file repeats nothing but "Bad conversion: bool"  it doesn't name where, or what or anything... to even remotely indicate where its happening

 

Well then start big to narrow down the search, disable large modules at the time to find the culprit then repeat the process on the part causing issues. 

 

Unfortunately there is no easy way to find it in this case. 

 

 

Share this post


Link to post
Share on other sites

Unfortunately its not the source nor cause of the bug, so back to the drawing board on locating it... and start adding in diag_log's....

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×