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:
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user