Scripts/Commands: Fixed remaining crashes caused by removal of dbc locales

This commit is contained in:
Shauren committed 2012-08-16 13:27:54 +02:00
1 parent 137d973e5d
commit 21b1b72a6b
6 files changed
+15 -37

No files matched your search

+1 -1
View File
@@ -444,7 +444,7 @@ public:
if (map->Instanceable())
{
handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->area_name[handler->GetSessionDbcLocale()], map->GetId(), map->GetMapName());
handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->area_name, map->GetId(), map->GetMapName());
handler->SetSentErrorMessage(true);
return false;
}
+3 -22
View File
@@ -394,33 +394,14 @@ public:
!skillInfo->canLink) // only prof with recipes have set
continue;
int locale = handler->GetSessionDbcLocale();
name = skillInfo->name[locale];
name = skillInfo->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, namePart))
{
locale = 0;
for (; locale < TOTAL_LOCALES; ++locale)
{
if (locale == handler->GetSessionDbcLocale())
continue;
continue;
name = skillInfo->name[locale];
if (name.empty())
continue;
if (Utf8FitTo(name, namePart))
break;
}
}
if (locale < TOTAL_LOCALES)
{
targetSkillInfo = skillInfo;
break;
}
targetSkillInfo = skillInfo;
}
if (!targetSkillInfo)
+7 -8
View File
@@ -1505,7 +1505,7 @@ public:
if (!target->GetSkillValue(skill))
{
handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name[handler->GetSessionDbcLocale()]);
handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name);
handler->SetSentErrorMessage(true);
return false;
}
@@ -1516,7 +1516,7 @@ public:
return false;
target->SetSkill(skill, target->GetSkillStep(skill), level, max);
handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], tNameLink.c_str(), level, max);
handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name, tNameLink.c_str(), level, max);
return true;
}
@@ -1754,7 +1754,6 @@ public:
handler->PSendSysMessage(LANG_PINFO_LEVEL, raceStr.c_str(), ClassStr.c_str(), timeStr.c_str(), level, gold, silv, copp);
// Add map, zone, subzone and phase to output
int locale = handler->GetSessionDbcLocale();
std::string areaName = "<unknown>";
std::string zoneName = "";
@@ -1763,22 +1762,22 @@ public:
AreaTableEntry const* area = GetAreaEntryByAreaID(areaId);
if (area)
{
areaName = area->area_name[locale];
areaName = area->area_name;
AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
if (zone)
zoneName = zone->area_name[locale];
zoneName = zone->area_name;
}
if (target)
{
if (!zoneName.empty())
handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], zoneName.c_str(), areaName.c_str(), phase);
handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name, zoneName.c_str(), areaName.c_str(), phase);
else
handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], areaName.c_str(), "<unknown>", phase);
handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name, areaName.c_str(), "<unknown>", phase);
}
else
handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str());
handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name, areaName.c_str());
return true;
}
+1 -1
View File
@@ -1231,7 +1231,7 @@ public:
if (factionEntry->reputationListID < 0)
{
handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name[handler->GetSessionDbcLocale()], factionId);
handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name, factionId);
handler->SetSentErrorMessage(true);
return false;
}
+1 -1
View File
@@ -94,7 +94,7 @@ public:
target->SetTitle(titleInfo); // to be sure that title now known
target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index);
handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, titleInfo->name[handler->GetSessionDbcLocale()], tNameLink.c_str());
handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, titleInfo->name, tNameLink.c_str());
return true;
}