1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

New files for lib:

* lib/ERMScriptModule.cpp
* lib/ERMScriptModule.h
* lib/CObstacleInstance.h

More jugglery with callbacks. Moving stuff from CGameState to CGameInfoCallback. Work on unified game events interface for player (AI or GUI) and script module. Directing events to ERM interpretetr, first attempts of calling some triggers. Crashy, if there any scripts.
Some other changes, including fighting amount of includes in includes and tracking of hero visits (need further work).
This commit is contained in:
Michał W. Urbańczyk
2011-05-09 22:20:47 +00:00
parent 743df272e4
commit 617e1f962e
33 changed files with 466 additions and 409 deletions

View File

@ -420,7 +420,7 @@ void CGObjectInstance::hideTiles(int ourplayer, int radius) const
if ( !vstd::contains(i->second.players, ourplayer ))//another team
{
for (std::set<ui8>::iterator j = i->second.players.begin(); j != i->second.players.end(); j++)
if ( cb->getPlayerState(*j)->status == PlayerState::INGAME )//seek for living player (if any)
if ( cb->getPlayer(*j)->status == PlayerState::INGAME )//seek for living player (if any)
{
FoWChange fw;
fw.mode = 0;
@ -2184,7 +2184,7 @@ int CGTownInstance::getMarketEfficiency() const
if(!vstd::contains(builtBuildings, 14))
return 0;
const PlayerState *p = cb->getPlayerState(tempOwner);
const PlayerState *p = cb->getPlayer(tempOwner);
assert(p);
int marketCount = 0;
@ -6313,7 +6313,7 @@ int3 IBoatGenerator::bestLocation() const
for (int i = 0; i < offsets.size(); ++i)
{
TerrainTile *tile = IObjectInterface::cb->getTile(o->pos + offsets[i]);
const TerrainTile *tile = IObjectInterface::cb->getTile(o->pos + offsets[i]);
if (tile) //tile is in the map
{
if (tile->tertype == TerrainTile::water && (!tile->blocked || tile->blockingObjects.front()->ID == 8)) //and is water and is not blocked or is blocked by boat
@ -6326,7 +6326,7 @@ int3 IBoatGenerator::bestLocation() const
int IBoatGenerator::state() const
{
int3 tile = bestLocation();
TerrainTile *t = IObjectInterface::cb->getTile(tile);
const TerrainTile *t = IObjectInterface::cb->getTile(tile);
if(!t)
return 2; //no available water
else if(!t->blockingObjects.size())