mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[11247] Prevent attemps save npc data without static spawns
Original patch provided by Vinolentus.
This commit is contained in:
parent
52b0748282
commit
189e7c08b7
2 changed files with 8 additions and 6 deletions
|
|
@ -1889,7 +1889,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(char* args)
|
|||
if (!ExtractUInt32(&args, lowguid)) // case .setmovetype $move_type (with selected creature)
|
||||
{
|
||||
pCreature = getSelectedCreature();
|
||||
if (!pCreature || pCreature->IsPet())
|
||||
if (!pCreature || !pCreature->HasStaticDBSpawnData())
|
||||
return false;
|
||||
lowguid = pCreature->GetGUIDLow();
|
||||
}
|
||||
|
|
@ -1980,7 +1980,8 @@ bool ChatHandler::HandleNpcSetModelCommand(char* args)
|
|||
pCreature->SetDisplayId(displayId);
|
||||
pCreature->SetNativeDisplayId(displayId);
|
||||
|
||||
pCreature->SaveToDB();
|
||||
if (pCreature->HasStaticDBSpawnData())
|
||||
pCreature->SaveToDB();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -2189,7 +2190,7 @@ bool ChatHandler::HandleNpcSetPhaseCommand(char* args)
|
|||
|
||||
pCreature->SetPhaseMask(phasemask,true);
|
||||
|
||||
if (!pCreature->IsPet())
|
||||
if (pCreature->HasStaticDBSpawnData())
|
||||
pCreature->SaveToDB();
|
||||
|
||||
return true;
|
||||
|
|
@ -2206,7 +2207,7 @@ bool ChatHandler::HandleNpcSetDeathStateCommand(char* args)
|
|||
}
|
||||
|
||||
Creature* pCreature = getSelectedCreature();
|
||||
if (!pCreature || pCreature->IsPet())
|
||||
if (!pCreature || !pCreature->HasStaticDBSpawnData())
|
||||
{
|
||||
SendSysMessage(LANG_SELECT_CREATURE);
|
||||
SetSentErrorMessage(true);
|
||||
|
|
@ -2797,12 +2798,13 @@ bool ChatHandler::HandleWpAddCommand(char* args)
|
|||
// No GUID provided
|
||||
// -> Player must have selected a creature
|
||||
|
||||
if (!target || target->IsPet())
|
||||
if (!target || !target->HasStaticDBSpawnData())
|
||||
{
|
||||
SendSysMessage(LANG_SELECT_CREATURE);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target->GetEntry() == VISUAL_WAYPOINT)
|
||||
{
|
||||
DEBUG_LOG("DEBUG: HandleWpAddCommand - target->GetEntry() == VISUAL_WAYPOINT (1) ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue