From f8b6f01ddef4bcf4f19d72a1e79fe70b847b9fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 8 Jun 2010 21:52:13 +0200 Subject: [PATCH] game: Don't resend quest or zone files when they didn't change. This fixes the lack of weapons and enemies when reaching B2 in a mission. --- src/egs_game.erl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/egs_game.erl b/src/egs_game.erl index f838243..de2f0c6 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -265,8 +265,11 @@ lobby_load(CSocket, GID, QuestID, ZoneID, MapID, EntryID) -> _ -> ignore end, - egs_proto:send_init_quest(CSocket, GID, QuestID), - egs_proto:send_quest(CSocket, QuestFile), + if OldUser#users.questid /= QuestID -> + egs_proto:send_init_quest(CSocket, GID, QuestID), + egs_proto:send_quest(CSocket, QuestFile); + true -> ignore + end, send_packet_0a05(CSocket, GID), case AreaType of lobby -> @@ -275,8 +278,11 @@ lobby_load(CSocket, GID, QuestID, ZoneID, MapID, EntryID) -> _ -> ignore end, - egs_proto:send_zone_init(CSocket, GID, lobby), - egs_proto:send_zone(CSocket, ZoneFile), + if OldUser#users.zoneid /= ZoneID -> + egs_proto:send_zone_init(CSocket, GID, lobby), + egs_proto:send_zone(CSocket, ZoneFile); + true -> ignore + end, egs_proto:send_map(CSocket, ZoneID, MapID, EntryID), egs_proto:send_location(CSocket, GID, QuestID, ZoneID, MapID, AreaName, 16#ffffffff), send_packet_020c(CSocket),