1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

- Partially fixed mantis #1065 (Gate with hex 95 can't be attacked)

- Fixed 'catapult tried to attack non-catapultable hex!' problem, now catapult attacks attackable wall parts only
- Fixed problem that the server performed applying damage on a wall part twice
- Added methods for checking what wall parts are attackable and if a wall part is potentially attackable
- Added functionality to trace net packages
- Added functionality to trace std::vectors
- Added tracing for CatapultAttack(CPack)
- Updated various toString methods to use {} instead of []
- Refactoring
This commit is contained in:
beegee1
2013-12-08 17:54:13 +00:00
parent 5de70ba235
commit 69eee05ccc
13 changed files with 156 additions and 87 deletions

View File

@ -35,6 +35,11 @@
#undef max
#endif
std::ostream & operator<<(std::ostream & out, const CPack * pack)
{
return out << pack->toString();
}
DLL_LINKAGE void SetResource::applyGs( CGameState *gs )
{
assert(player < PlayerColor::PLAYER_LIMIT);
@ -1508,6 +1513,22 @@ DLL_LINKAGE void CatapultAttack::applyGs( CGameState *gs )
}
}
DLL_LINKAGE std::string CatapultAttack::AttackInfo::toString() const
{
return boost::str(boost::format("{AttackInfo: destinationTile '%d', attackedPart '%d', damageDealt '%d'}")
% destinationTile % static_cast<int>(attackedPart) % static_cast<int>(damageDealt));
}
DLL_LINKAGE std::ostream & operator<<(std::ostream & out, const CatapultAttack::AttackInfo & attackInfo)
{
return out << attackInfo.toString();
}
DLL_LINKAGE std::string CatapultAttack::toString() const
{
return boost::str(boost::format("{CatapultAttack: attackedParts '%s', attacker '%d'}") % attackedParts % attacker);
}
DLL_LINKAGE void BattleStacksRemoved::applyGs( CGameState *gs )
{
if(!gs->curB)