All pastes #914123 Raw Edit

Miscellany

public cpp v1 · immutable
·published 2008-02-22 17:15 UTC
rendered paste body
Index: src/game/Level2.cpp===================================================================--- src/game/Level2.cpp	(revision 5278)+++ src/game/Level2.cpp	(working copy)@@ -995,7 +995,38 @@      char* guid_str = strtok((char*)args, " ");     char* wait_str = strtok((char*)NULL, " ");+  +	char* text1    = strtok((char*)NULL, " ");+  	char* text2    = strtok((char*)NULL, " ");+	char* text3    = strtok((char*)NULL, " ");+	char* text4    = strtok((char*)NULL, " ");+	char* text5    = strtok((char*)NULL, " "); +	std::string text1 = *text1;+	std::string text2 = *text2;+	std::string text3 = *text3;+	std::string text4 = *text4;+	std::string text5 = *text5;++  +    WorldDatabase.escape_string(text1);+    WorldDatabase.escape_string(text2);+    WorldDatabase.escape_string(text3); +	WorldDatabase.escape_string(text4);+	WorldDatabase.escape_string(text5);++     if(text1 == "")+		  text1 = NULL;+     if(text2 == "")+		  text2 = NULL;+     if(text3 == "")+		  text3 = NULL;+     if(text4 == "")+		  text4 = NULL;+     if(text5 == "")+		  text5 = NULL;+ +     uint32 lowguid = atoi((char*)guid_str);      Creature* pCreature = NULL;@@ -1039,8 +1070,8 @@      Player* player = m_session->GetPlayer(); -    WorldDatabase.PExecuteLog("INSERT INTO `creature_movement` (`id`,`point`,`position_x`,`position_y`,`position_z`,`waittime`) VALUES ('%u','%u','%f', '%f', '%f','%u')",-        lowguid, point, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), wait);+    WorldDatabase.PExecuteLog("INSERT INTO `creature_movement` (`id`,`point`,`position_x`,`position_y`,`position_z`,`waittime`,`text1`,`text2`,`text3`,`text4`,`text5`) VALUES ('%u','%u','%f', '%f', '%f','%u','%s','%s','%s','%s','%s')",+        lowguid, point, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), wait, text1, text2, text3, text4, text5);      // update movement type     WorldDatabase.PExecuteLog("UPDATE `creature` SET `MovementType` = '%u' WHERE `guid` = '%u'", WAYPOINT_MOTION_TYPE,lowguid);