1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

vcmi: specialize native terrain entity

Specialize native terrain entity for all object that have
native terrain. Allow creatures to take global bonuses into
account when checking for native terrain.
This commit is contained in:
Konstantin
2023-04-05 18:56:28 +03:00
parent 6d9859932b
commit 0f5f4c69ec
14 changed files with 122 additions and 8 deletions

20
lib/BasicTypes.cpp Normal file
View File

@@ -0,0 +1,20 @@
/*
* BasicTypes.cpp, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "GameConstants.h"
#include <vcmi/Entity.h>
bool INativeTerrainProvider::isItNativeTerrain(TerrainId terrain) const
{
auto native = getNativeTerrain();
return native == terrain || native == ETerrainId::ANY_TERRAIN;
}