Closed klyxmaster closed 6 years ago
Is not "or" it is "||", so it'll be like this:
if (IsStaticMapItem(cur) || (cur == 0))
I recommend to change the check for null first, like this:
if ((cur == 0) || IsStaticMapItem(cur))
remember, you are adding a null item in the static item, maybe you want it be diffrent from null (0)
if ((cur != 0) && IsStaticMapItem(cur))
this check for 'cur' being not null and a static map item, so you're not adding a null item in the list.
hope this helps.
"or" is keyword for "||" on newer gcc and windows compilers for g++0x11 and later. your compiler doesnt like conditional keywords (Error C3861 'or': identifier not found) , so this will need to be changed to "||" as stranho suggested. there will be other conditional keywords you will have to search for and replace also. stranho is right in suggesting checking for null first, this particular code is being passed a list of itemIDs to search the db for. in this case, it dont matter which one you test first, either static item or "0", as it will insert the value into the 'staticItem" vector if either of those are true. however, i have found a value of "0" will throw an error if the db search is allowed, and the client doesnt like it, either.
i have updated this check to throw an error when "0" is passed (which happens on rare occasions), but have not updated this codebase.
this entire conditional block should be as follows:
for (auto cur : entityIDs) { if (cur == 0) { sLog.Error("GetMultiLocationsEx", "Client sent 0"); continue; } if (IsStaticMapItem(cur) or (cur == 0)) staticItem.push_back(cur); else dynamicItem.push_back(cur); }
when i get time i'll look over the code and update.
let us know if you have any other problems.
the following looks correct but the compiler is throwing an error: any ideas I can try?