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

Update for previous rev. Support for synchronous building demolition.

This commit is contained in:
DjWarmonger
2009-09-22 14:27:46 +00:00
parent 1f92b2af2c
commit 7c2b54844f
7 changed files with 65 additions and 6 deletions

View File

@@ -1984,7 +1984,7 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid )
if(gs->canBuildStructure(t,bid) != 7)
{
complain("Cannot build that building!");
complain("Cannot raze that building!");
return false;
}
@@ -2035,6 +2035,19 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid )
return true;
}
bool CGameHandler::razeStructure (si32 tid, si32 bid)
{
///incomplete, simply erases target building
CGTownInstance * t = static_cast<CGTownInstance*>(gs->map->objects[tid]);
if (t->builtBuildings.find(bid) == t->builtBuildings.end())
return false;
RazeStructures rs;
rs.tid = tid;
rs.bid.insert(bid);
rs.builded = t->destroyed + 1; //define TRUE FALSE?
sendAndApply(&rs);
return true;
}
void CGameHandler::sendMessageToAll( const std::string &message )
{