浏览代码

small update

mateuszb 18 年之前
父节点
当前提交
e12976a9fe
共有 2 个文件被更改,包括 7 次插入7 次删除
  1. 4 4
      hch/CObjectHandler.cpp
  2. 3 3
      mapHandler.cpp

+ 4 - 4
hch/CObjectHandler.cpp

@@ -160,14 +160,14 @@ bool CGObjectInstance::operator<(const CGObjectInstance & cmp) const  //screen p
 		return true;
 	if(this->pos.y>cmp.pos.y)
 		return false;
-	if(defInfo->isOnDefList && !(cmp.defInfo->isOnDefList))
-		return true;
-	if(cmp.defInfo->isOnDefList && !(defInfo->isOnDefList))
-		return false;
 	if(!defInfo->isVisitable() && cmp.defInfo->isVisitable())
 		return true;
 	if(!cmp.defInfo->isVisitable() && defInfo->isVisitable())
 		return false;
+	if(defInfo->isOnDefList && !(cmp.defInfo->isOnDefList))
+		return true;
+	if(cmp.defInfo->isOnDefList && !(defInfo->isOnDefList))
+		return false;
 	if(this->pos.x<cmp.pos.x)
 		return true;
 	return false;

+ 3 - 3
mapHandler.cpp

@@ -1857,7 +1857,7 @@ std::string CMapHandler::getRandomizedDefName(CGDefInfo *di, CGObjectInstance *
 					}
 				}
 			}
-			int lvl = atoi(di->name.substr(7, 8).c_str())-1;
+			int lvl = atoi(di->name.substr(7, 8).c_str());
 			return creGenNames[fraction][lvl];
 		}
 		else
@@ -1874,7 +1874,7 @@ std::string CMapHandler::getRandomizedDefName(CGDefInfo *di, CGObjectInstance *
 				possibleTowns.push_back(8);
 
 			int fraction = possibleTowns[rand()%possibleTowns.size()];
-			int lvl = atoi(di->name.substr(7, 8).c_str())-1;
+			int lvl = atoi(di->name.substr(7, 8).c_str());
 			return creGenNames[fraction][lvl];
 		}
 	}
@@ -1966,7 +1966,7 @@ std::string CMapHandler::getRandomizedDefName(CGDefInfo *di, CGObjectInstance *
 		creGenNames[F_NUMBER-1].push_back(CGI->dobjinfo->objs[457].defName);
 		creGenNames[F_NUMBER-1].push_back(CGI->dobjinfo->objs[458].defName);
 
-		int faction = atoi(di->name.substr(7, 8).c_str())-1;
+		int faction = atoi(di->name.substr(7, 8).c_str());
 
 		int lvl = -1;
 		CCreGen3ObjInfo * ct = (CCreGen3ObjInfo*)obj->info;