Console Error from Prepared Statement

Issue #57 resolved
Josh Carter created an issue

I'm getting duplicate Key error from the prepared statment

PrepareStatement(CHAR_INS_NPCBOT, "INSERT INTO character_npcbot (owner, entry, race, class, istank) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC);

In CharacterDatabase.cpp

I changed the statement to...

PrepareStatement(CHAR_INS_NPCBOT, "REPLACE INTO character_npcbot (owner, entry, race, class, istank) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC);

That seems to have fixed the console error.

Comments (3)

  1. trickerer repo owner

    This is a serious matter, cuz that means some player has summoned bot with same entry twice, this should never happen. I never had such error.
    Let's see, It may happen if there is an error in another PS which selects stored npcbots. I think it is the only way to summon npcbot twice.

  2. Log in to comment