@@ -48,7 +48,8 @@ const unsigned short WANDER_RADIUS_SOLDIERS = 15;
4848noFigure::noFigure (const Job job, const MapPoint pos, const unsigned char player, noRoadNode* const goal)
4949 : noMovable(NodalObjectType::Figure, pos), fs(FigureState::GotToGoal), job_(job), player(player), cur_rs(nullptr ),
5050 rs_pos(0 ), rs_dir(false ), on_ship(false ), goal_(goal), waiting_for_free_node(false ), wander_way(0 ),
51- wander_tryings(0 ), flagPos_(MapPoint::Invalid()), flag_obj_id(0 ), burned_wh_id(0xFFFFFFFF ), last_id(0xFFFFFFFF )
51+ wander_tryings(0 ), flagPos_(MapPoint::Invalid()), flag_obj_id(0 ), burned_wh_id(0xFFFFFFFF ), last_id(0xFFFFFFFF ),
52+ armor(false )
5253{
5354 // Haben wir ein Ziel?
5455 // Gehen wir in ein Lagerhaus? Dann dürfen wir da nicht unsere Arbeit ausführen, sondern
@@ -62,7 +63,8 @@ noFigure::noFigure(const Job job, const MapPoint pos, const unsigned char player
6263noFigure::noFigure (const Job job, const MapPoint pos, const unsigned char player)
6364 : noMovable(NodalObjectType::Figure, pos), fs(FigureState::Job), job_(job), player(player), cur_rs(nullptr ),
6465 rs_pos(0 ), rs_dir(false ), on_ship(false ), goal_(nullptr ), waiting_for_free_node(false ), wander_way(0 ),
65- wander_tryings(0 ), flagPos_(MapPoint::Invalid()), flag_obj_id(0 ), burned_wh_id(0xFFFFFFFF ), last_id(0xFFFFFFFF )
66+ wander_tryings(0 ), flagPos_(MapPoint::Invalid()), flag_obj_id(0 ), burned_wh_id(0xFFFFFFFF ), last_id(0xFFFFFFFF ),
67+ armor(false )
6668{}
6769
6870void noFigure::Destroy ()
@@ -85,6 +87,7 @@ void noFigure::Serialize(SerializedGameData& sgd) const
8587 sgd.PushUnsignedShort (rs_pos);
8688 sgd.PushBool (rs_dir);
8789 sgd.PushBool (on_ship);
90+ sgd.PushBool (armor);
8891
8992 if (fs == FigureState::GotToGoal || fs == FigureState::GoHome)
9093 sgd.PushObject (goal_);
@@ -104,7 +107,7 @@ void noFigure::Serialize(SerializedGameData& sgd) const
104107noFigure::noFigure (SerializedGameData& sgd, const unsigned obj_id)
105108 : noMovable(sgd, obj_id), fs(sgd.Pop<FigureState>()), job_(sgd.Pop<Job>()), player(sgd.PopUnsignedChar()),
106109 cur_rs(sgd.PopObject<RoadSegment>(GO_Type::Roadsegment)), rs_pos(sgd.PopUnsignedShort()), rs_dir(sgd.PopBool()),
107- on_ship(sgd.PopBool()), last_id(0xFFFFFFFF )
110+ on_ship(sgd.PopBool()), last_id(0xFFFFFFFF ), armor(sgd.GetGameDataVersion() >= 12 ? sgd.PopBool() : false)
108111{
109112 if (fs == FigureState::GotToGoal || fs == FigureState::GoHome)
110113 goal_ = sgd.PopObject <noRoadNode>();
0 commit comments