diff --git a/common/version.h b/common/version.h index ba57cf898..c45ef76d8 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9134 +#define CURRENT_BINARY_DATABASE_VERSION 9135 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9021 #else diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 7a7523c94..9e3a7190f 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -388,6 +388,7 @@ 9132|2018_12_16_global_base_scaling.sql|SHOW TABLES LIKE 'npc_scale_global_base'|empty| 9133|2018_11_25_StuckBehavior.sql|SHOW COLUMNS FROM `npc_types` LIKE 'stuck_behavior'|empty| 9134|2019_01_04_update_global_base_scaling.sql|SELECT * FROM db_version WHERE version >= 9134|empty| +9135|2019_01_10_multi_version_spawns.sql|SELECT * FROM db_version WHERE version >= 9135|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/required/2019_01_10_multi_version_spawns.sql b/utils/sql/git/required/2019_01_10_multi_version_spawns.sql new file mode 100644 index 000000000..c15bd0146 --- /dev/null +++ b/utils/sql/git/required/2019_01_10_multi_version_spawns.sql @@ -0,0 +1 @@ +ALTER TABLE `spawn2` MODIFY `version` SMALLINT(5) SIGNED NOT NULL DEFAULT '0'; \ No newline at end of file diff --git a/zone/npc.cpp b/zone/npc.cpp index 8de819e0c..16a508d1f 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1388,7 +1388,7 @@ uint32 ZoneDatabase::DeleteSpawnRemoveFromNPCTypeTable(const char *zone, uint32 uint32 spawngroupID = 0; std::string query = StringFormat("SELECT id, spawngroupID FROM spawn2 WHERE zone = '%s' " - "AND version = %u AND spawngroupID = %i", + "AND (version = %u OR version = -1) AND spawngroupID = %i", zone, zone_version, spawn->GetSp2()); auto results = QueryDatabase(query); if (!results.Success()) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 3a6142c42..e004faa4a 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -488,7 +488,7 @@ bool ZoneDatabase::PopulateZoneSpawnListClose(uint32 zoneid, LinkedList "animation " "FROM " "spawn2 " - "WHERE zone = '%s' AND version = %u", + "WHERE zone = '%s' AND (version = %u OR version = -1) ", zone_name, version ); @@ -592,7 +592,7 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList &spa "animation " "FROM " "spawn2 " - "WHERE zone = '%s' AND version = %u", + "WHERE zone = '%s' AND (version = %u OR version = -1)", zone_name, version );