diff options
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index d9d54353246..c71e0f01940 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -1106,7 +1106,13 @@ public: if (!*args) return false; - uint32 phase = (uint32) atoi((char*)args); + uint32 phaseID = uint32(atoi((char*)args)); + if (!sPhaseStore.LookupEntry(phaseID)) + { + handler->SendSysMessage(LANG_PHASE_NOTFOUND); + handler->SetSentErrorMessage(true); + return false; + } Creature* creature = handler->getSelectedCreature(); if (!creature || creature->IsPet()) @@ -1117,8 +1123,8 @@ public: } creature->ClearPhases(); - creature->SetInPhase(phase, true, true); - creature->SetDBPhase(phase); + creature->SetInPhase(phaseID, true, true); + creature->SetDBPhase(phaseID); creature->SaveToDB(); |
