mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 17:13:51 +00:00
fix(sql): substitute generic displayId for NPCs with displayId=0
A creature_template row with modelid1=0 spawns an invisible NPC in-game. Fall back to 11707 (a generic humanoid) on export so "Creature"-named placeholder spawns are at least usable; the user can edit the displayId after.
This commit is contained in:
parent
1e378fb4ce
commit
d96d040831
1 changed files with 6 additions and 1 deletions
|
|
@ -67,6 +67,11 @@ bool SQLExporter::exportCreatures(const std::vector<CreatureSpawn>& spawns,
|
|||
uint32_t unitFlags = 0;
|
||||
if (!s.hostile) unitFlags |= 0x02; // NON_ATTACKABLE
|
||||
|
||||
// displayId=0 results in an invisible NPC in-game. Fall back to
|
||||
// 11707 (a generic humanoid) so the export is at least usable;
|
||||
// the user can fix it after if they meant something else.
|
||||
uint32_t displayId = s.displayId == 0 ? 11707 : s.displayId;
|
||||
|
||||
f << "INSERT INTO `creature_template` "
|
||||
<< "(`entry`, `name`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, "
|
||||
<< "`mana`, `armor`, `mindmg`, `maxdmg`, `faction`, `npcflag`, "
|
||||
|
|
@ -79,7 +84,7 @@ bool SQLExporter::exportCreatures(const std::vector<CreatureSpawn>& spawns,
|
|||
<< s.minDamage << ", " << s.maxDamage << ", "
|
||||
<< s.faction << ", " << npcFlags << ", "
|
||||
<< unitFlags << ", "
|
||||
<< s.displayId << ", "
|
||||
<< displayId << ", "
|
||||
<< s.scale
|
||||
<< ") ON DUPLICATE KEY UPDATE `name`='" << escapeSql(s.name) << "';\n";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue