mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +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 "../spells/CSpellHandler.h"
|
||||
#include "../CSkillHandler.h"
|
||||
#include "../mapObjects/CObjectHandler.h"
|
||||
#include "../IGameCallback.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
@ -132,7 +134,10 @@ namespace JsonRandom
|
||||
{
|
||||
std::set<std::string> defaultSkills;
|
||||
for(const auto & skill : VLC->skillh->objects)
|
||||
{
|
||||
IObjectInterface::cb->isAllowed(2, skill->getIndex());
|
||||
defaultSkills.insert(skill->getNameTextID());
|
||||
}
|
||||
|
||||
for(const auto & element : value.Vector())
|
||||
{
|
||||
@ -177,6 +182,9 @@ namespace JsonRandom
|
||||
|
||||
if(!allowedClasses.empty() && !allowedClasses.count(art->aClass))
|
||||
return false;
|
||||
|
||||
if(!IObjectInterface::cb->isAllowed(1, art->getIndex()))
|
||||
return false;
|
||||
|
||||
if(!allowedPositions.empty())
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user