Jump to content

Recommended Posts

  • Active+ Member

hello, when I create an item after something I add, I get game.core. can you help me ?

spacer.png

spacer.png

 

split_value func:

#include <vector>
void split_value(std::string str, std::string splitBy, std::vector<std::string>& tokens)
{
	tokens.push_back(str);

	size_t splitAt;
	size_t splitLen = splitBy.size();
	std::string frag;
	while (true)
	{
		frag = tokens.back();
		splitAt = frag.find(splitBy);
		if (splitAt == std::string::npos)
			break;

		tokens.back() = frag.substr(0, splitAt);
		tokens.push_back(frag.substr(splitAt + splitLen, frag.size() - (splitAt + splitLen)));
	}
}

item_manager.cpp

This is the hidden content, please

 

line to crash(359):

 

					const TItemTable* item_table = item->GetProto();

					for (int i = 0; i < ITEM_RANDOM_VALUES_MAX_NUM; i++)
					{
						if (!item_table->alSockets[i])
							continue;

						std::string foo = std::to_string(item_table->alSockets[i]);
						std::vector<std::string> results;
						split_value(foo, "00", results);

359:					const auto irandomValue = static_cast<uint16_t>(number(atoi(results[0].c_str()), atoi(results[1].c_str())));
						item->SetRandomDefaultAttr(i, irandomValue);
					}


 

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Metin2 Dev 1
  • Facepalm 1
Link to comment
Share on other sites

  • Active+ Member
2 hours ago, Draveniou1 said:

add fuction

 

(!your fuction)
{
return;
}

I wrote the following code for testing purposes and it gave core on this line. There is an error in the function but I couldn't understand what it is.

 

						sys_err("result0 %s, result1 %s", atoi(results[0].c_str()), atoi(results[1].c_str()));

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.