Browse Source

Merge pull request #33 from rhn/develop

Fixed wrong message when building a structure, Rewarding objects won't loose their state on reload
Ivan Savenko 11 years ago
parent
commit
42b349a594
2 changed files with 4 additions and 4 deletions
  1. 3 3
      lib/CGameInfoCallback.cpp
  2. 1 1
      lib/mapObjects/CGHeroInstance.h

+ 3 - 3
lib/CGameInfoCallback.cpp

@@ -408,12 +408,12 @@ EBuildingState::EBuildingState CGameInfoCallback::canBuildStructure( const CGTow
 		return t->hasBuilt(id);
 	};
 
-	if(t->builded >= VLC->modh->settings.MAX_BUILDING_PER_TURN)
-		return EBuildingState::CANT_BUILD_TODAY; //building limit
-
 	if (!building->requirements.test(buildTest))
 		return EBuildingState::PREREQUIRES;
 
+	if(t->builded >= VLC->modh->settings.MAX_BUILDING_PER_TURN)
+		return EBuildingState::CANT_BUILD_TODAY; //building limit
+
 	if (building->upgrade != BuildingID::NONE && !t->hasBuilt(building->upgrade))
 		return EBuildingState::MISSING_BASE;
 

+ 1 - 1
lib/mapObjects/CGHeroInstance.h

@@ -222,7 +222,7 @@ public:
 		h & exp & level & name & biography & portrait & mana & secSkills & movement
 			& sex & inTownGarrison & spells & patrol & moveDir & skillsInfo;
 		h & visitedTown & boat;
-		h & type & specialty & commander;
+		h & type & specialty & commander & visitedObjects;
 		BONUS_TREE_DESERIALIZATION_FIX
 		//visitied town pointer will be restored by map serialization method
 	}