From f3120f26ee7e073cac261db26d1d5415bb0164fd Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Fri, 20 Nov 2015 12:03:43 -0500 Subject: [PATCH 1/3] Fix issue with mobs no depopping (due to spawn_events) while zone is idle. --- zone/entity.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 69b13e6eb..af256a9ba 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -468,17 +468,27 @@ void EntityList::CorpseProcess() void EntityList::MobProcess() { -#ifdef IDLE_WHEN_EMPTY - if (numclients < 1) - return; -#endif + bool mob_dead; + auto it = mob_list.begin(); while (it != mob_list.end()) { uint16 id = it->first; Mob *mob = it->second; size_t sz = mob_list.size(); - bool p_val = mob->Process(); + +#ifdef IDLE_WHEN_EMPTY + // spawn_events can cause spawns and deaths while zone empty. + // At the very least, process that. + if (numclients < 1) { + mob_dead = mob->CastToNPC()->GetDepop(); + } + else { + mob_dead = !mob->Process(); + } +#else + mob_dead = !mob->Process(); +#endif size_t a_sz = mob_list.size(); if(a_sz > sz) { @@ -491,7 +501,7 @@ void EntityList::MobProcess() ++it; } - if(!p_val) { + if(mob_dead) { if(mob->IsNPC()) { entity_list.RemoveNPC(id); } From d383ecc5b716ee5108888fd0b3f2eae75b3f2d0f Mon Sep 17 00:00:00 2001 From: Uleat Date: Sun, 22 Nov 2015 18:31:32 -0500 Subject: [PATCH 2/3] Fix for loginserver project compile failure --- changelog.txt | 3 +++ loginserver/CMakeLists.txt | 2 +- loginserver/database_mysql.cpp | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 742edb5a5..8533293f0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 11/22/2015 == +Uleat: Fix for loginserver project compile failure + == 11/7/2015 == Akkadius: Implemented #repopclose [distance in units] - Used for development purposes, defaults to 500 units - Real case use: Large zones with 700 NPC's and you are making fast quick tweaks to nearby NPC's you can refresh just the NPC's around you instead of all in the zone diff --git a/loginserver/CMakeLists.txt b/loginserver/CMakeLists.txt index f588cbc48..bdd1bba07 100644 --- a/loginserver/CMakeLists.txt +++ b/loginserver/CMakeLists.txt @@ -43,7 +43,7 @@ ADD_EXECUTABLE(loginserver ${eqlogin_sources} ${eqlogin_headers}) INSTALL(TARGETS loginserver RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) -TARGET_LINK_LIBRARIES(loginserver common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE}) +TARGET_LINK_LIBRARIES(loginserver common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY}) IF(MSVC) SET_TARGET_PROPERTIES(loginserver PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF") diff --git a/loginserver/database_mysql.cpp b/loginserver/database_mysql.cpp index cffec5548..2e69dfca3 100644 --- a/loginserver/database_mysql.cpp +++ b/loginserver/database_mysql.cpp @@ -26,8 +26,6 @@ extern ErrorLog *server_log; extern LoginServer server; -#pragma comment(lib, "mysqlclient.lib") - DatabaseMySQL::DatabaseMySQL(string user, string pass, string host, string port, string name) { this->user = user; From 4bc844fe3b153c42530f2a19f8a0018ef49d8c66 Mon Sep 17 00:00:00 2001 From: Natedog2012 Date: Tue, 24 Nov 2015 16:25:19 -0800 Subject: [PATCH 3/3] Work around for Bot::LoadPetBuffs loading buffs with counters --- zone/bot.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zone/bot.cpp b/zone/bot.cpp index 477581eba..9909c6d5d 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -2026,6 +2026,16 @@ void Bot::LoadPetBuffs(SpellBuff_Struct* petBuffs, uint32 botPetSaveId) { petBuffs[buffIndex].spellid = atoi(row[0]); petBuffs[buffIndex].level = atoi(row[1]); petBuffs[buffIndex].duration = atoi(row[2]); + //Work around for loading the counters and setting them back to max. Need entry in DB for saved counters + if(CalculatePoisonCounters(petBuffs[buffIndex].spellid) > 0) + petBuffs[buffIndex].counters = CalculatePoisonCounters(petBuffs[buffIndex].spellid); + else if(CalculateDiseaseCounters(petBuffs[buffIndex].spellid) > 0) + petBuffs[buffIndex].counters = CalculateDiseaseCounters(petBuffs[buffIndex].spellid); + else if(CalculateCurseCounters(petBuffs[buffIndex].spellid) > 0) + petBuffs[buffIndex].counters = CalculateCurseCounters(petBuffs[buffIndex].spellid); + else if(CalculateCorruptionCounters(petBuffs[buffIndex].spellid) > 0) + petBuffs[buffIndex].counters = CalculateCorruptionCounters(petBuffs[buffIndex].spellid); + buffIndex++; } query = StringFormat("DELETE FROM `bot_pet_buffs` WHERE `pets_index` = %u;", botPetSaveId);