TrinityCore/TrinityCore — Issue #5466: [GM Command] GO Creature doesn't work for names with spaces
Author: MrSmite
Created: 2012-02-27 22:06:10+00:00
State: open

Rev: c15f7bfc193a2f9e05e999e3ade588002df366e2
OS: XP SP3
DB: 46 + updates

Description:

When you use .go creature on an NPC with spaces in the name, the comand fails with "Creature not found" even though using .lookup creatue does find the creature.

Example: .go creature Gakin the Darkbinder

I looked briefly at the code and found two possible issues:

* The SQL doesn't use the % signs with the LIKE operator which means it is taking it as a literal

The SQL should look like this: WHERE name LIKE %Gakin% instead of WHERE name LIKE Gakin

* The "whereclause" seems to be ignored by the WorldDatabase.pquery() function.

When I looked at the value for the SQL in the query function, there was no WHERE clause attached...