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