浏览代码

minor:
- siege tower shooters use string ID's
- cmake will install vcmibuilder with correct permissions
- vcmibuilder will not extract outdated config files from core.zip

Ivan Savenko 13 年之前
父节点
当前提交
16b72ee89b
共有 4 个文件被更改,包括 22 次插入12 次删除
  1. 4 1
      CMakeLists.txt
  2. 9 9
      config/buildings.json
  3. 5 1
      lib/CTownHandler.cpp
  4. 4 1
      vcmibuilder

+ 4 - 1
CMakeLists.txt

@@ -114,7 +114,10 @@ if (NOT APPLE)
 	# copy only fs.json for WoG
 	install(FILES Mods/WoG/filesystem.json DESTINATION ${DATA_DIR}/Mods/WoG)
 
-	install(FILES vcmibuilder DESTINATION ${BIN_DIR})
+	install(FILES vcmibuilder DESTINATION ${BIN_DIR} PERMISSIONS
+		OWNER_WRITE OWNER_READ OWNER_EXECUTE
+		            GROUP_READ GROUP_EXECUTE
+		            WORLD_READ WORLD_EXECUTE)
 endif()
 
 if(WIN32)

+ 9 - 9
config/buildings.json

@@ -196,7 +196,7 @@
 
 			"siege" :
 			{
-				"shooter" : 2,
+				"shooter" : "Archer",
 				"imagePrefix" : "SGCS",
 				"gate" :
 				{
@@ -447,7 +447,7 @@
 
 			"siege" :
 			{
-				"shooter" : 18,
+				"shooter" : "WoodElf",
 				"imagePrefix" : "SGRM",
 				"gate" :
 				{
@@ -691,7 +691,7 @@
 
 			"siege" :
 			{
-				"shooter" : 34,
+				"shooter" : "Mage",
 				"imagePrefix" : "SGTW",
 				"gate" :
 				{
@@ -937,7 +937,7 @@
 
 			"siege" :
 			{
-				"shooter" : 44,
+				"shooter" : "Gog",
 				"imagePrefix" : "SGIN",
 				"gate" :
 				{
@@ -1186,7 +1186,7 @@
 
 			"siege" :
 			{
-				"shooter" : 64,
+				"shooter" : "Lich",
 				"imagePrefix" : "SGNC",
 				"gate" :
 				{
@@ -1429,7 +1429,7 @@
 
 			"siege" :
 			{
-				"shooter" : 76,
+				"shooter" : "Beholder",
 				"imagePrefix" : "SGDN",
 				"gate" :
 				{
@@ -1671,7 +1671,7 @@
 
 			"siege" :
 			{
-				"shooter" : 88,
+				"shooter" : "Orc",
 				"imagePrefix" : "SGST",
 				"gate" :
 				{
@@ -1916,7 +1916,7 @@
 
 			"siege" :
 			{
-				"shooter" : 100,
+				"shooter" : "PrimitiveLizardman",
 				"imagePrefix" : "SGFR",
 				"gate" :
 				{
@@ -2164,7 +2164,7 @@
 
 			"siege" :
 			{
-				"shooter" : 127,
+				"shooter" : "StormElemental",
 				"imagePrefix" : "SGEL",
 				"gate" :
 				{

+ 5 - 1
lib/CTownHandler.cpp

@@ -334,7 +334,11 @@ CTown::ClientInfo::Point JsonToPoint(const JsonNode & node)
 void CTownHandler::loadSiegeScreen(CTown &town, const JsonNode & source)
 {
 	town.clientInfo.siegePrefix = source["imagePrefix"].String();
-	town.clientInfo.siegeShooter = source["shooter"].Float();
+	VLC->modh->identifiers.requestIdentifier(std::string("creature.") + source["shooter"].String(), [&town](si32 creature)
+	{
+		town.clientInfo.siegeShooter = creature;
+	});
+
 	town.clientInfo.siegeShooterCropHeight = source["shooterHeight"].Float();
 
 	auto & pos = town.clientInfo.siegePositions;

+ 4 - 1
vcmibuilder

@@ -235,7 +235,10 @@ fi
 if [[ -n "$vcmi_archive" ]]
 then
 	echo "decompressing $vcmi_archive"
-	unzip -qo $vcmi_archive -d $dest_dir || fail "Error: failed to extract VCMI archive!"
+	# exlude *json - temporary solution for autotools -> cmake transition period
+	# 0.90 packages made by autotools do not have .json files available in svn
+	# cmake however can install them correctly so they should not be extracted from .zip in case of cmake package
+	unzip -qo $vcmi_archive -d $dest_dir -x "*.json" "*.txt" "*.PAL" || fail "Error: failed to extract VCMI archive!"
 fi
 
 if [[ -n "$validate" ]]