Trinitycore: .npc info command crashing worldserver.exe

Created on 2 May 2016  路  4Comments  路  Source: TrinityCore/TrinityCore

Description:

Short issue: .npc info command crashes the worldserver executable when entering the command.

Current behaviour: Tell us what happens

Whenever I try to use the '.npc info' command on a targeted NPC (doesn't matter which NPC), the server stops but you are still able to walk around. Just not do anything like enter commands, chat, open shops, etc. When I looked in my VPS is said the worldserver.exe has stopped working. So I imagine the problem is somewhere in the cs_npc.cpp. Now I did some forum requesting and a forum members thinks it could be something along this code of MY script:

if (CreatureData const* data = sObjectMgr->GetCreatureData(target->GetSpawnId()))       
        {       
            handler->PSendSysMessage(LANG_NPCINFO_PHASES, data->phaseid, data->phaseGroup);     
            if (data->phaseGroup)       
            {       
                std::set<uint32> _phases = target->GetPhases();     
                if (!_phases.empty())       
                {       
                    handler->PSendSysMessage(LANG_NPCINFO_PHASE_IDS);       
                    for (uint32 phaseId : _phases)      
                        handler->PSendSysMessage("%u", phaseId);        
                }       
            }       
        }

Expected behaviour: Tell us what should happen instead

I would assume knowing that TC is good when it comes to commands that the command I'm trying to use should work. Seeing that I searched before this time and nothing came up plus that it's working for other people.

Steps to reproduce the problem:

  1. Target any NPC
  2. run the command '.npc info'
  3. Worldserver.exe stops responding

Branch(es): 335/6x

6x

TC hash/commit:

b4c12d269983

TDB version:

TDB_full_6.04_2016_04

Operating system:

Windows 2008 R2 Standard

Linking model: static/dynamic

Static

Most helpful comment

If you need a good example on how to fill in a new issue post, check out aaplmike's issue #17067.

All 4 comments

Don't forget to say how it crashes the core! Steps to reproduce it.

In the "Steps to reproduce the problem:" section, you could fill in which steps other users can do to reproduce/replicate your issue. Maybe something like ths (change your post by entering the exact steps):

  1. Target any NPC
  2. Run the command .npc info
  3. Worldserver stops responding

(you can add extra steps if necessary, like if it is important to check the worldserver console).

To verify your setting in the "Linking model: static/dynamic" section, check and verify if you changed the CMake setting SCRIPTS to see if it says 'static' or 'dynamic' ('static' is the default CMake setting).

@tkrokli Thank you!
You made my life 99% easier for understanding all this!!

If you need a good example on how to fill in a new issue post, check out aaplmike's issue #17067.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cbcs picture cbcs  路  3Comments

DDuarte picture DDuarte  路  3Comments

Rochet2 picture Rochet2  路  3Comments

Teppic1 picture Teppic1  路  3Comments

Keader picture Keader  路  3Comments