Core/Misc: Misc Fixes

This commit is contained in:
hondacrx
2018-05-22 00:43:21 -04:00
parent 5dacd669b5
commit 0be2dc08e2
19 changed files with 72 additions and 115 deletions
+1 -1
View File
@@ -539,7 +539,7 @@ namespace Game.Chat.Commands
string accountName;
// "account" case, name can be get in same query
if (result.GetRowCount() > 1)
if (result.GetFieldCount() > 1)
accountName = result.Read<string>(1);
// "character" case, name need extract from another DB
else
+3 -2
View File
@@ -71,8 +71,6 @@ namespace Game.Chat.Commands
handler.SendSysMessage(CypherStrings.CommandGocreatnotfound);
return false;
}
if (result.GetRowCount() > 1)
handler.SendSysMessage(CypherStrings.CommandGocreatmultiple);
float x = result.Read<float>(0);
float y = result.Read<float>(1);
@@ -80,6 +78,9 @@ namespace Game.Chat.Commands
float o = result.Read<float>(3);
uint mapId = result.Read<ushort>(4);
if (result.NextRow())
handler.SendSysMessage(CypherStrings.CommandGocreatmultiple);
if (!GridDefines.IsValidMapCoord(mapId, x, y, z, o) || Global.ObjectMgr.IsTransportMap(mapId))
{
handler.SendSysMessage(CypherStrings.InvalidTargetCoord, x, y, mapId);
+6 -21
View File
@@ -210,15 +210,10 @@ namespace Game.Chat.Commands
itemPos = "";
handler.SendSysMessage(CypherStrings.ItemlistSlot, itemGuid.ToString(), ownerName, ownerGuid.ToString(), ownerAccountId, itemPos);
count--;
}
while (result.NextRow());
uint resultCount = (uint)result.GetRowCount();
if (count > resultCount)
count -= resultCount;
else if (count != 0)
count = 0;
}
// mail case
@@ -256,15 +251,10 @@ namespace Game.Chat.Commands
string itemPos = "[in mail]";
handler.SendSysMessage(CypherStrings.ItemlistMail, itemGuid, itemSenderName, itemSender, itemSenderAccountId, itemReceiverName, itemReceiver, itemReceiverAccount, itemPos);
count--;
}
while (result.NextRow());
uint resultCount = (uint)result.GetRowCount();
if (count > resultCount)
count -= resultCount;
else if (count != 0)
count = 0;
}
// auction case
@@ -329,15 +319,10 @@ namespace Game.Chat.Commands
string itemPos = "[in guild bank]";
handler.SendSysMessage(CypherStrings.ItemlistGuild, itemGuid.ToString(), guildName, guildGuid.ToString(), itemPos);
count--;
}
while (result.NextRow());
uint resultCount = (uint)result.GetRowCount();
if (count > resultCount)
count -= resultCount;
else if (count != 0)
count = 0;
}
if (inventoryCount + mailCount + auctionCount + guildCount == 0)