mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-09 13:14:02 +02:00
Banned arts and skills cannot be randomly rewarded
This commit is contained in:
parent
26c3277895
commit
b40a3a1b14
@ -21,6 +21,8 @@
|
|||||||
#include "../CCreatureSet.h"
|
#include "../CCreatureSet.h"
|
||||||
#include "../spells/CSpellHandler.h"
|
#include "../spells/CSpellHandler.h"
|
||||||
#include "../CSkillHandler.h"
|
#include "../CSkillHandler.h"
|
||||||
|
#include "../mapObjects/CObjectHandler.h"
|
||||||
|
#include "../IGameCallback.h"
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_BEGIN
|
VCMI_LIB_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@ -132,7 +134,10 @@ namespace JsonRandom
|
|||||||
{
|
{
|
||||||
std::set<std::string> defaultSkills;
|
std::set<std::string> defaultSkills;
|
||||||
for(const auto & skill : VLC->skillh->objects)
|
for(const auto & skill : VLC->skillh->objects)
|
||||||
|
{
|
||||||
|
IObjectInterface::cb->isAllowed(2, skill->getIndex());
|
||||||
defaultSkills.insert(skill->getNameTextID());
|
defaultSkills.insert(skill->getNameTextID());
|
||||||
|
}
|
||||||
|
|
||||||
for(const auto & element : value.Vector())
|
for(const auto & element : value.Vector())
|
||||||
{
|
{
|
||||||
@ -178,6 +183,9 @@ namespace JsonRandom
|
|||||||
if(!allowedClasses.empty() && !allowedClasses.count(art->aClass))
|
if(!allowedClasses.empty() && !allowedClasses.count(art->aClass))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if(!IObjectInterface::cb->isAllowed(1, art->getIndex()))
|
||||||
|
return false;
|
||||||
|
|
||||||
if(!allowedPositions.empty())
|
if(!allowedPositions.empty())
|
||||||
{
|
{
|
||||||
for(const auto & pos : art->possibleSlots[ArtBearer::HERO])
|
for(const auto & pos : art->possibleSlots[ArtBearer::HERO])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user