Remove hardcoded NPC spawns CSV and fallback, require DB for spawns

This commit is contained in:
Kelsi 2026-02-05 14:14:13 -08:00
parent 0605d1522d
commit 26cd0bc57d
2 changed files with 2 additions and 37 deletions

View file

@ -1,17 +0,0 @@
# map,name,m2Path,level,health,wowX,wowY,wowZ,rotation,scale,isCritter,coordSpace
# Canonical WoW coordinates: +X north, +Y west, +Z up.
# Optional runtime tuning:
# WOW_NPC_OFFSET=dx,dy
# WOW_NPC_SWAP_XY=1
# WOW_NPC_ROT_DEG=90
# WOW_NPC_PIVOT=x,y (canonical pivot for rotation; defaults to player position)
Azeroth,Innkeeper Farley,Creature\HumanMalePeasant\HumanMalePeasant.m2,30,5000,10.8,-9463.5,57.0459,3.03687,1.0,0,canonical
Azeroth,Smith Argus,Creature\HumanMalePeasant\HumanMalePeasant.m2,24,4200,87.8553,-9456.65,59.6271,2.40855,1.0,0,canonical
Azeroth,Corina Steele,Creature\HumanFemalePeasant\HumanFemalePeasant.m2,22,3800,93.9896,-9464.87,58.5271,0.0,1.0,0,canonical
Azeroth,Goldshire Guard,Creature\HumanMaleGuard\HumanMaleGuard.m2,60,42000,-8.0,-9472.0,57.5,0.1,1.0,0,canonical
Azeroth,Goldshire Guard,Creature\HumanMaleGuard\HumanMaleGuard.m2,60,42000,31.0,-9475.0,57.2,2.8,1.0,0,canonical
Azeroth,Stormwind Citizen,Creature\HumanFemalePeasant\HumanFemalePeasant.m2,5,1200,28.0,-9451.0,57.2,3.50,1.0,0,canonical
Azeroth,Stormwind Citizen,Creature\HumanMalePeasant\HumanMalePeasant.m2,5,1200,42.0,-9482.0,57.4,1.80,1.0,0,canonical
Azeroth,Wolf,Creature\Wolf\Wolf.m2,1,42,-38.0,-9528.0,56.5,0.70,1.0,1,canonical
Azeroth,Chicken,Creature\Chicken\Chicken.m2,1,10,12.0,-9448.0,57.0,2.00,1.0,1,canonical
Azeroth,Cat,Creature\Cat\Cat.m2,1,42,63.0,-9492.0,57.0,4.50,1.0,1,canonical
1 # map,name,m2Path,level,health,wowX,wowY,wowZ,rotation,scale,isCritter,coordSpace
2 # Canonical WoW coordinates: +X north, +Y west, +Z up.
3 # Optional runtime tuning:
4 # WOW_NPC_OFFSET=dx,dy
5 # WOW_NPC_SWAP_XY=1
6 # WOW_NPC_ROT_DEG=90
7 # WOW_NPC_PIVOT=x,y (canonical pivot for rotation; defaults to player position)
8 Azeroth,Innkeeper Farley,Creature\HumanMalePeasant\HumanMalePeasant.m2,30,5000,10.8,-9463.5,57.0459,3.03687,1.0,0,canonical
9 Azeroth,Smith Argus,Creature\HumanMalePeasant\HumanMalePeasant.m2,24,4200,87.8553,-9456.65,59.6271,2.40855,1.0,0,canonical
10 Azeroth,Corina Steele,Creature\HumanFemalePeasant\HumanFemalePeasant.m2,22,3800,93.9896,-9464.87,58.5271,0.0,1.0,0,canonical
11 Azeroth,Goldshire Guard,Creature\HumanMaleGuard\HumanMaleGuard.m2,60,42000,-8.0,-9472.0,57.5,0.1,1.0,0,canonical
12 Azeroth,Goldshire Guard,Creature\HumanMaleGuard\HumanMaleGuard.m2,60,42000,31.0,-9475.0,57.2,2.8,1.0,0,canonical
13 Azeroth,Stormwind Citizen,Creature\HumanFemalePeasant\HumanFemalePeasant.m2,5,1200,28.0,-9451.0,57.2,3.50,1.0,0,canonical
14 Azeroth,Stormwind Citizen,Creature\HumanMalePeasant\HumanMalePeasant.m2,5,1200,42.0,-9482.0,57.4,1.80,1.0,0,canonical
15 Azeroth,Wolf,Creature\Wolf\Wolf.m2,1,42,-38.0,-9528.0,56.5,0.70,1.0,1,canonical
16 Azeroth,Chicken,Creature\Chicken\Chicken.m2,1,10,12.0,-9448.0,57.0,2.00,1.0,1,canonical
17 Azeroth,Cat,Creature\Cat\Cat.m2,1,42,63.0,-9492.0,57.0,4.50,1.0,1,canonical

View file

@ -660,7 +660,7 @@ void NpcManager::initialize(pipeline::AssetManager* am,
" offset=(", globalDx, ", ", globalDy, ")");
}
std::vector<NpcSpawnDef> spawnDefs = loadSpawnDefsFromFile("assets/npcs/singleplayer_spawns.csv");
std::vector<NpcSpawnDef> spawnDefs;
std::string dbBasePath;
if (const char* dbBase = std::getenv("WOW_DB_BASE_PATH")) {
dbBasePath = dbBase;
@ -672,25 +672,7 @@ void NpcManager::initialize(pipeline::AssetManager* am,
if (!dbDefs.empty()) spawnDefs = std::move(dbDefs);
}
if (spawnDefs.empty()) {
LOG_WARNING("NpcManager: using built-in NPC spawns (assets/npcs/singleplayer_spawns.csv missing)");
spawnDefs = {
{"Azeroth", 0, "Innkeeper Farley", "Creature\\HumanMalePeasant\\HumanMalePeasant.m2",
30, 5000, glm::vec3(76.0f, -9468.0f, 205.0f), false, 3.1f, 1.0f, false},
{"Azeroth", 0, "Bernard Gump", "Creature\\HumanMalePeasant\\HumanMalePeasant.m2",
25, 4200, glm::vec3(92.0f, -9478.0f, 205.0f), false, 1.2f, 1.0f, false},
{"Azeroth", 0, "Stormwind Guard", "Creature\\HumanMaleGuard\\HumanMaleGuard.m2",
60, 42000, glm::vec3(86.0f, -9478.0f, 205.0f), false, 0.1f, 1.0f, false},
{"Azeroth", 0, "Stormwind Guard", "Creature\\HumanMaleGuard\\HumanMaleGuard.m2",
60, 42000, glm::vec3(37.0f, -9440.0f, 205.0f), false, 2.8f, 1.0f, false},
{"Azeroth", 0, "Stormwind Citizen", "Creature\\HumanFemalePeasant\\HumanFemalePeasant.m2",
5, 1200, glm::vec3(62.0f, -9468.0f, 205.0f), false, 3.5f, 1.0f, false},
{"Azeroth", 0, "Stormwind Citizen", "Creature\\HumanMalePeasant\\HumanMalePeasant.m2",
5, 1200, glm::vec3(23.0f, -9518.0f, 205.0f), false, 1.8f, 1.0f, false},
{"Azeroth", 0, "Chicken", "Creature\\Chicken\\Chicken.m2",
1, 10, glm::vec3(58.0f, -9534.0f, 205.0f), false, 2.0f, 1.0f, true},
{"Azeroth", 0, "Cat", "Creature\\Cat\\Cat.m2",
1, 42, glm::vec3(90.0f, -9446.0f, 205.0f), false, 4.5f, 1.0f, true}
};
LOG_WARNING("NpcManager: no spawn defs found (DB required for single-player)");
}
// Spawn only nearby placements on current map.