1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
This commit is contained in:
SoundSSGood 2023-05-17 17:05:09 +03:00
parent 5b281e6a9e
commit 1175990724
7 changed files with 16 additions and 13 deletions

View File

@ -82,7 +82,7 @@ void CArtifactsOfHeroAltar::pickedArtMoveToAltar(const ArtifactPosition & slot)
{
if(ArtifactUtils::isSlotBackpack(slot) || ArtifactUtils::isSlotEquipment(slot) || slot == ArtifactPosition::TRANSITION_POS)
{
assert(!curHero->getSlot(pickedArtFromSlot)->getArt());
assert(curHero->getSlot(slot)->getArt());
LOCPLINT->cb->swapArtifacts(ArtifactLocation(curHero, slot), ArtifactLocation(curHero, pickedArtFromSlot));
pickedArtFromSlot = ArtifactPosition::PRE_FIRST;
}

View File

@ -184,7 +184,7 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
${MAIN_LIB_DIR}/vstd/StringUtils.cpp
${MAIN_LIB_DIR}/ArtifactUtils.cpp
${MAIN_LIB_DIR}/ArtifactUtils.cpp
${MAIN_LIB_DIR}/BasicTypes.cpp
${MAIN_LIB_DIR}/BattleFieldHandler.cpp
${MAIN_LIB_DIR}/CAndroidVMHelper.cpp
@ -470,6 +470,7 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
${MAIN_LIB_DIR}/spells/effects/Sacrifice.h
${MAIN_LIB_DIR}/AI_Base.h
${MAIN_LIB_DIR}/ArtifactUtils.h
${MAIN_LIB_DIR}/BattleFieldHandler.h
${MAIN_LIB_DIR}/CAndroidVMHelper.h
${MAIN_LIB_DIR}/CArtHandler.h

View File

@ -1,5 +1,5 @@
/*
* CArtHandler.cpp, part of VCMI engine
* ArtifactUtils.cpp, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
@ -8,12 +8,11 @@
*
*/
#include "StdInc.h"
#include "CArtHandler.h"
#include "GameSettings.h"
#include "ArtifactUtils.h"
#include "CArtHandler.h"
#include "GameSettings.h"
#include "mapping/CMap.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -1,5 +1,5 @@
/*
* CArtHandler.h, part of VCMI engine
* ArtifactUtils.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
@ -9,7 +9,8 @@
*/
#pragma once
#include <vector>
#include "StdInc.h"
#include "GameConstants.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -933,7 +933,7 @@ void CCombinedArtifactInstance::addAsConstituent(CArtifactInstance * art, const
void CCombinedArtifactInstance::removeFrom(ArtifactLocation al)
{
CArtifactInstance::removeFrom(al);
for(auto & part : constituentsInfo)
for (auto& part : constituentsInfo)
{
if(part.slot != ArtifactPosition::PRE_FIRST)
part.slot = ArtifactPosition::PRE_FIRST;

View File

@ -9,6 +9,7 @@
*/
#include "StdInc.h"
#include "inspector.h"
#include "../lib/ArtifactUtils.h"
#include "../lib/CArtHandler.h"
#include "../lib/spells/CSpellHandler.h"
#include "../lib/CHeroHandler.h"
@ -171,7 +172,7 @@ void Initializer::initialize(CGArtifact * o)
out.push_back(spell->id);
}
}
auto a = CArtifactInstance::createScroll(*RandomGeneratorUtil::nextItem(out, CRandomGenerator::getDefault()));
auto a = ArtifactUtils::createScroll(*RandomGeneratorUtil::nextItem(out, CRandomGenerator::getDefault()));
o->storedArtifact = a;
}
}
@ -528,7 +529,7 @@ void Inspector::setProperty(CGArtifact * o, const QString & key, const QVariant
{
if(spell->getJsonKey() == value.toString().toStdString())
{
o->storedArtifact = CArtifactInstance::createScroll(spell->getId());
o->storedArtifact = ArtifactUtils::createScroll(spell->getId());
break;
}
}

View File

@ -10,6 +10,7 @@
#include "mapcontroller.h"
#include "../lib/ArtifactUtils.h"
#include "../lib/GameConstants.h"
#include "../lib/mapping/CMapService.h"
#include "../lib/mapping/CMap.h"
@ -185,7 +186,7 @@ void MapController::repairMap()
out.push_back(spell->id);
}
}
auto a = CArtifactInstance::createScroll(*RandomGeneratorUtil::nextItem(out, CRandomGenerator::getDefault()));
auto a = ArtifactUtils::createScroll(*RandomGeneratorUtil::nextItem(out, CRandomGenerator::getDefault()));
art->storedArtifact = a;
}
else