• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Infinite Loop on Load Items (Items.cpp) of tfs 0.3.6pl1 for MSVC

reges31

New Member
Joined
May 23, 2009
Messages
4
Reaction score
0
Hello guy,
There is one infinite loop on the function Items:: parseItems at line: 1191 of items.cpp. It seems like one workaround to compile with MSVC as it wont compile code with more than 128 if..else if sentences.

The code is:
Code:
...
#ifndef _MSC_VER
			else if(tmpStrValue == "reflectpercentall")
#else
			else
				notLoaded = true;

			if(!notLoaded)
			{

				continue;
			}

			if(tmpStrValue == "reflectpercentall")
			...
#endif

To correct the code just don't forget point the node to the next node before calling continue keyword:
Code:
...
#ifndef _MSC_VER
			else if(tmpStrValue == "reflectpercentall")
#else
			else
				notLoaded = true;

			if(!notLoaded)
			{
				itemAttributesNode = itemAttributesNode->next;			// Dont forget set it to the next node
				continue;
			}

			if(tmpStrValue == "reflectpercentall")
			...
#endif
 
Back
Top