mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +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)
|
if (!ExtractUInt32(&args, lowguid)) // case .setmovetype $move_type (with selected creature)
|
||||||
{
|
{
|
||||||
pCreature = getSelectedCreature();
|
pCreature = getSelectedCreature();
|
||||||
if (!pCreature || pCreature->IsPet())
|
if (!pCreature || !pCreature->HasStaticDBSpawnData())
|
||||||
return false;
|
return false;
|
||||||
lowguid = pCreature->GetGUIDLow();
|
lowguid = pCreature->GetGUIDLow();
|
||||||
}
|
}
|
||||||
|
|
@ -1980,6 +1980,7 @@ bool ChatHandler::HandleNpcSetModelCommand(char* args)
|
||||||
pCreature->SetDisplayId(displayId);
|
pCreature->SetDisplayId(displayId);
|
||||||
pCreature->SetNativeDisplayId(displayId);
|
pCreature->SetNativeDisplayId(displayId);
|
||||||
|
|
||||||
|
if (pCreature->HasStaticDBSpawnData())
|
||||||
pCreature->SaveToDB();
|
pCreature->SaveToDB();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -2189,7 +2190,7 @@ bool ChatHandler::HandleNpcSetPhaseCommand(char* args)
|
||||||
|
|
||||||
pCreature->SetPhaseMask(phasemask,true);
|
pCreature->SetPhaseMask(phasemask,true);
|
||||||
|
|
||||||
if (!pCreature->IsPet())
|
if (pCreature->HasStaticDBSpawnData())
|
||||||
pCreature->SaveToDB();
|
pCreature->SaveToDB();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -2206,7 +2207,7 @@ bool ChatHandler::HandleNpcSetDeathStateCommand(char* args)
|
||||||
}
|
}
|
||||||
|
|
||||||
Creature* pCreature = getSelectedCreature();
|
Creature* pCreature = getSelectedCreature();
|
||||||
if (!pCreature || pCreature->IsPet())
|
if (!pCreature || !pCreature->HasStaticDBSpawnData())
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_SELECT_CREATURE);
|
SendSysMessage(LANG_SELECT_CREATURE);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -2797,12 +2798,13 @@ bool ChatHandler::HandleWpAddCommand(char* args)
|
||||||
// No GUID provided
|
// No GUID provided
|
||||||
// -> Player must have selected a creature
|
// -> Player must have selected a creature
|
||||||
|
|
||||||
if (!target || target->IsPet())
|
if (!target || !target->HasStaticDBSpawnData())
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_SELECT_CREATURE);
|
SendSysMessage(LANG_SELECT_CREATURE);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target->GetEntry() == VISUAL_WAYPOINT)
|
if (target->GetEntry() == VISUAL_WAYPOINT)
|
||||||
{
|
{
|
||||||
DEBUG_LOG("DEBUG: HandleWpAddCommand - target->GetEntry() == VISUAL_WAYPOINT (1) ");
|
DEBUG_LOG("DEBUG: HandleWpAddCommand - target->GetEntry() == VISUAL_WAYPOINT (1) ");
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11246"
|
#define REVISION_NR "11247"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue