diff --git a/src/login/loginclif.cpp b/src/login/loginclif.cpp
index 844f8a085ac..6b40b0c3c67 100644
--- a/src/login/loginclif.cpp
+++ b/src/login/loginclif.cpp
@@ -172,7 +172,7 @@ static void logclif_auth_failed( int32 fd, int32 result, const char* unblock_tim
p.packetType = HEADER_AC_REFUSE_LOGIN;
p.error = result;
- safestrncpy( p.unblock_time, "", sizeof( p.unblock_time ) );
+ safestrncpy( p.unblock_time, unblock_time, sizeof( p.unblock_time ) );
socket_send( fd, p );
}
diff --git a/src/map/CMakeLists.txt b/src/map/CMakeLists.txt
index 5b0904a8b83..45f17cbdfd0 100644
--- a/src/map/CMakeLists.txt
+++ b/src/map/CMakeLists.txt
@@ -13,6 +13,13 @@ file(GLOB_RECURSE MAP_HEADERS ${MAP_SOURCE_DIR}/*.hpp)
list(FILTER MAP_HEADERS EXCLUDE REGEX ".*/skills/.*")
file(GLOB_RECURSE MAP_SOURCES ${MAP_SOURCE_DIR}/*.cpp)
list(FILTER MAP_SOURCES EXCLUDE REGEX ".*/skills/.*")
+# Add skill factory/impl files as separate translation units per job category
+# Individual skill files are NOT compiled directly - they are #included by their job factory TUs
+file(GLOB SKILL_FACTORY_SOURCES ${MAP_SOURCE_DIR}/skills/skill_factory.cpp ${MAP_SOURCE_DIR}/skills/skill_impl.cpp)
+file(GLOB SKILL_JOB_FACTORY_SOURCES ${MAP_SOURCE_DIR}/skills/*/skill_factory_*.cpp)
+list(APPEND MAP_SOURCES ${SKILL_FACTORY_SOURCES} ${SKILL_JOB_FACTORY_SOURCES})
+file(GLOB_RECURSE SKILL_HEADERS ${MAP_SOURCE_DIR}/skills/*.hpp)
+list(APPEND MAP_HEADERS ${SKILL_HEADERS})
set( DEPENDENCIES common ryml)
set( LIBRARIES ${GLOBAL_LIBRARIES} ${MYSQL_LIBRARIES} )
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${COMMON_BASE_INCLUDE_DIRS} ${RA_INCLUDE_DIRS} ${MYSQL_INCLUDE_DIRS} )
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index 41b684316d8..66bbd258dcf 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -28,6 +28,12 @@ MAP_H = $(shell find ../ -type f -name "*.hpp") \
MAP_OBJ = $(shell find . -type f -name "*.cpp" \
-not -path "./skills/*" \
| sed -e "s/\.cpp/\.o/g" -e "s/^\.\///")
+# Add skill factory/impl files as separate translation units per job category
+# Individual skill files are NOT compiled directly - they are #included by their job factory TUs
+MAP_OBJ += $(shell find ./skills -maxdepth 1 -type f -name "*.cpp" \
+ | sed -e "s/\.cpp/\.o/g" -e "s/^\.\///")
+MAP_OBJ += $(shell find ./skills -mindepth 2 -type f -name "skill_factory_*.cpp" \
+ | sed -e "s/\.cpp/\.o/g" -e "s/^\.\///")
#MAP_OBJ += $(shell ls *.c | sed -e "s/\.c/\.o/g")
MAP_DIR_OBJ = $(MAP_OBJ:%=obj/%)
MAP_GEN_DIR_OBJ = $(MAP_OBJ:%=obj-gen/%)
diff --git a/src/map/map-server-generator.vcxproj b/src/map/map-server-generator.vcxproj
index 4aa265c1f71..1775fd5d46d 100644
--- a/src/map/map-server-generator.vcxproj
+++ b/src/map/map-server-generator.vcxproj
@@ -238,6 +238,8 @@
+
+
@@ -284,6 +286,8 @@
+
+
diff --git a/src/map/map-server.vcxproj b/src/map/map-server.vcxproj
index 21361d2f015..d3618e7cfaa 100644
--- a/src/map/map-server.vcxproj
+++ b/src/map/map-server.vcxproj
@@ -1792,9 +1792,7 @@
true
-
- true
-
+
true
@@ -2125,9 +2123,7 @@
true
-
- true
-
+
true
@@ -2224,9 +2220,7 @@
true
-
- true
-
+
true
@@ -2323,9 +2317,7 @@
true
-
- true
-
+
true
@@ -2497,9 +2489,7 @@
true
-
- true
-
+
true
@@ -2659,9 +2649,7 @@
true
-
- true
-
+
true
@@ -2962,9 +2950,7 @@
true
-
- true
-
+
true
@@ -3202,9 +3188,7 @@
true
-
- true
-
+
true
@@ -3448,9 +3432,7 @@
true
-
- true
-
+
true
@@ -3685,9 +3667,7 @@
true
-
- true
-
+
true
@@ -3757,9 +3737,7 @@
true
-
- true
-
+
true
@@ -4087,9 +4065,7 @@
true
-
- true
-
+
true
@@ -4339,9 +4315,7 @@
true
-
- true
-
+
true
@@ -4351,12 +4325,8 @@
true
-
- true
-
-
- true
-
+
+
true
@@ -4450,9 +4420,7 @@
true
-
- true
-
+
true
@@ -4666,9 +4634,7 @@
true
-
- true
-
+
true
@@ -4846,9 +4812,7 @@
true
-
- true
-
+
true
@@ -5221,9 +5185,7 @@
true
-
- true
-
+
true
diff --git a/src/map/skill.cpp b/src/map/skill.cpp
index 0e5e8172e8b..bcaf8d69e41 100755
--- a/src/map/skill.cpp
+++ b/src/map/skill.cpp
@@ -46,9 +46,9 @@
#include "status.hpp"
#include "unit.hpp"
-// Include .cpp files into the TU to optimize compile time
-// For reference see unity builds or amalgamated builds
-#include "skills/skill_factory.cpp"
+// Skill factory is compiled as separate translation units per job category
+// to reduce peak memory usage during compilation
+#include "skills/skill_factory.hpp"
using namespace rathena;
diff --git a/src/map/skills/skill_factory.cpp b/src/map/skills/skill_factory.cpp
index 13c66c5d6e2..25c2e4aad30 100644
--- a/src/map/skills/skill_factory.cpp
+++ b/src/map/skills/skill_factory.cpp
@@ -10,26 +10,24 @@
// This will save compile time
#ifndef MAP_GENERATOR
-// Include .cpp files into the TU to optimize compile time
-// For reference see unity builds or amalgamated builds
-#include "./skill_impl.cpp"
-#include "./acolyte/skill_factory_acolyte.cpp"
-#include "./archer/skill_factory_archer.cpp"
-#include "./custom/skill_factory_custom.cpp"
-#include "./elemental/skill_factory_elemental.cpp"
-#include "./gunslinger/skill_factory_gunslinger.cpp"
-#include "./homunculus/skill_factory_homunculus.cpp"
-#include "./mage/skill_factory_mage.cpp"
-#include "./mercenary/skill_factory_mercenary.cpp"
-#include "./merchant/skill_factory_merchant.cpp"
-#include "./npc/skill_factory_npc.cpp"
-#include "./ninja/skill_factory_ninja.cpp"
-#include "./novice/skill_factory_novice.cpp"
-#include "./other/skill_factory_other.cpp"
-#include "./summoner/skill_factory_summoner.cpp"
-#include "./swordman/skill_factory_swordman.cpp"
-#include "./taekwon/skill_factory_taekwon.cpp"
-#include "./thief/skill_factory_thief.cpp"
+// Include job factory headers for the create() dispatcher
+#include "./acolyte/skill_factory_acolyte.hpp"
+#include "./archer/skill_factory_archer.hpp"
+#include "./custom/skill_factory_custom.hpp"
+#include "./elemental/skill_factory_elemental.hpp"
+#include "./gunslinger/skill_factory_gunslinger.hpp"
+#include "./homunculus/skill_factory_homunculus.hpp"
+#include "./mage/skill_factory_mage.hpp"
+#include "./mercenary/skill_factory_mercenary.hpp"
+#include "./merchant/skill_factory_merchant.hpp"
+#include "./npc/skill_factory_npc.hpp"
+#include "./ninja/skill_factory_ninja.hpp"
+#include "./novice/skill_factory_novice.hpp"
+#include "./other/skill_factory_other.hpp"
+#include "./summoner/skill_factory_summoner.hpp"
+#include "./swordman/skill_factory_swordman.hpp"
+#include "./taekwon/skill_factory_taekwon.hpp"
+#include "./thief/skill_factory_thief.hpp"
std::unique_ptr SkillFactoryImpl::create(const e_skill skill_id) const {
static const std::vector> factories = {