Bläddra i källkod

Merge branch 'FixJacquesSpawnScript' of pboyd04/EQ2EMu into master

image 4 år sedan
förälder
incheckning
e13973b2b2

+ 11 - 1
EQ2/source/WorldServer/LuaFunctions.cpp

@@ -2844,7 +2844,13 @@ int EQ2Emu_lua_OfferQuest(lua_State* state) {
 		Quest* master_quest = master_quest_list.GetQuest(quest_id);
 		if (master_quest) {
 			Client* client = player->GetZone()->GetClientBySpawn(player);
+			if(!client) {
+				lua_interface->LogError("%s: LUA OfferQuest command error: client is not set", lua_interface->GetScriptName(state));
+			}
 			Quest* quest = new Quest(master_quest);
+			if(!quest) {
+				lua_interface->LogError("%s: LUA OfferQuest command error: new Quest() failed.", lua_interface->GetScriptName(state));
+			}
 			if (client && quest) {
 				client->AddPendingQuest(quest);
 				if (npc)
@@ -2852,7 +2858,11 @@ int EQ2Emu_lua_OfferQuest(lua_State* state) {
 				else
 					quest->SetQuestGiver(0);
 			}
+		} else {
+			lua_interface->LogError("%s: LUA OfferQuest command error: failed to get quest %d", lua_interface->GetScriptName(state), quest_id);
 		}
+	} else {
+		lua_interface->LogError("%s: LUA OfferQuest command error: player is not set or bad quest id %p %d", lua_interface->GetScriptName(state), player, quest_id);
 	}
 	return 0;
 }
@@ -9917,4 +9927,4 @@ int EQ2Emu_lua_GetTemporaryTransportID(lua_State* state) {
 		return 1;
 	}
 	return 0;
-}
+}

+ 2 - 2
server/SpawnScripts/ThunderingSteppes/Jacques.lua

@@ -133,7 +133,7 @@ function dlg_3_1(NPC, Spawn)
 end
 
 function dlg_4_1(NPC, Spawn)
-	OfferQuest(NPC, Player, WatchYourStepInTheTSPartIII)
+	OfferQuest(NPC, Spawn, WatchYourStepInTheTSPartIII)
 end
 	
 function dlg_4_2(NPC, Spawn)
@@ -155,4 +155,4 @@ end
 
 function dlg_6_1(NPC, Spawn)
 	OfferQuest(NPC, Player, WatchYourStepInTheTSPartIV)
-end
+end