Fixed crash issue with outfit window with protocols <= 860
This commit is contained in:
parent
f73b3bbece
commit
09425eba31
|
@ -89,7 +89,7 @@ local function onClotheCheckChange(clotheButtonBox)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function updateOutfit()
|
local function updateOutfit()
|
||||||
if table.empty(outfits) then
|
if table.empty(outfits) or not outfit then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local nameWidget = outfitWindow:getChildById('outfitName')
|
local nameWidget = outfitWindow:getChildById('outfitName')
|
||||||
|
@ -184,8 +184,10 @@ function Outfit.create(creatureOutfit, outfitList, creatureMount, mountList)
|
||||||
local colorBoxPanel = outfitWindow:getChildById('colorBoxPanel')
|
local colorBoxPanel = outfitWindow:getChildById('colorBoxPanel')
|
||||||
outfitCreatureBox:setCreature(outfitCreature)
|
outfitCreatureBox:setCreature(outfitCreature)
|
||||||
|
|
||||||
|
if mountCreature then
|
||||||
local mountCreatureBox = outfitWindow:getChildById('mountCreatureBox')
|
local mountCreatureBox = outfitWindow:getChildById('mountCreatureBox')
|
||||||
mountCreatureBox:setCreature(mountCreature)
|
mountCreatureBox:setCreature(mountCreature)
|
||||||
|
end
|
||||||
|
|
||||||
for j=0,6 do
|
for j=0,6 do
|
||||||
for i=0,18 do
|
for i=0,18 do
|
||||||
|
|
|
@ -45,6 +45,7 @@ void Game::resetGameStates()
|
||||||
{
|
{
|
||||||
m_denyBotCall = false;
|
m_denyBotCall = false;
|
||||||
m_dead = false;
|
m_dead = false;
|
||||||
|
m_mounted = false;
|
||||||
m_serverBeat = 50;
|
m_serverBeat = 50;
|
||||||
m_canReportBugs = false;
|
m_canReportBugs = false;
|
||||||
m_fightMode = Otc::FightBalanced;
|
m_fightMode = Otc::FightBalanced;
|
||||||
|
@ -333,12 +334,18 @@ void Game::processOpenOutfitWindow(const Outfit& currentOufit, const std::vector
|
||||||
virtualOutfitCreature->setOutfit(currentOufit);
|
virtualOutfitCreature->setOutfit(currentOufit);
|
||||||
|
|
||||||
// creature virtual mount outfit
|
// creature virtual mount outfit
|
||||||
CreaturePtr virtualMountCreature = CreaturePtr(new Creature);
|
CreaturePtr virtualMountCreature = nullptr;
|
||||||
|
if(getFeature(Otc::GamePlayerMounts))
|
||||||
|
{
|
||||||
|
virtualMountCreature = CreaturePtr(new Creature);
|
||||||
virtualMountCreature->setDirection(Otc::South);
|
virtualMountCreature->setDirection(Otc::South);
|
||||||
|
if(currentOufit.getMount() > 0)
|
||||||
|
{
|
||||||
Outfit mountOutfit;
|
Outfit mountOutfit;
|
||||||
mountOutfit.setId(currentOufit.getMount());
|
mountOutfit.setId(currentOufit.getMount());
|
||||||
virtualMountCreature->setOutfit(mountOutfit);
|
virtualMountCreature->setOutfit(mountOutfit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_lua.callGlobalField("g_game", "onOpenOutfitWindow", virtualOutfitCreature, outfitList, virtualMountCreature, mountList);
|
g_lua.callGlobalField("g_game", "onOpenOutfitWindow", virtualOutfitCreature, outfitList, virtualMountCreature, mountList);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue