Ver código fonte

Fix for Portal of Summoning. (ID is type of object, id is position of object instance in the map vector of object instances)
Most correct way of getting visitable position ;)

Michał W. Urbańczyk 15 anos atrás
pai
commit
49b7fc590d
2 arquivos alterados com 5 adições e 5 exclusões
  1. 3 3
      lib/NetPacksLib.cpp
  2. 2 2
      server/CGameHandler.cpp

+ 3 - 3
lib/NetPacksLib.cpp

@@ -732,10 +732,10 @@ DLL_EXPORT void HeroLevelUp::applyGs( CGameState *gs )
 					}
 					switch (it->subtype)
 					{
-						case 1:
-							it->val = (level * (*creatures)[it->additionalInfo]->attack)/creLevel /20;
+					case 1:
+						it->val = (level * (*creatures)[it->additionalInfo]->attack)/creLevel /20;
 						break;
-						case 2:
+					case 2:
 							it->val = (level * (*creatures)[it->additionalInfo]->defence)/creLevel /20;
 							break;
 					}

+ 2 - 2
server/CGameHandler.cpp

@@ -1886,7 +1886,7 @@ bool CGameHandler::teleportHero(si32 hid, si32 dstid, ui8 source, ui8 asker/* =
 		&& complain("Cannot teleport hero to town without Castle gate in it"))
 			return false;
 	int3 pos = t->visitablePos();
-	pos.x++;//FIXME: get visitable position in more correct way (if any)
+	pos += h->getVisitableOffset();
 	stopHeroVisitCastle(from->id, hid);
 	moveHero(hid,pos,1);
 	heroVisitCastle(dstid, hid);
@@ -1916,7 +1916,7 @@ void CGameHandler::setOwner(int objid, ui8 owner)
 	}
 	
 	const CGObjectInstance * obj = getObj(objid);
-	if ((obj->id == 17 || obj->id == 20 ) && gs->getPlayer(owner)->dwellings.size()==1 )//first dwelling captured
+	if ((obj->ID == 17 || obj->ID == 20 ) && gs->getPlayer(owner)->dwellings.size()==1 )//first dwelling captured
 		BOOST_FOREACH(const CGTownInstance *t, gs->getPlayer(owner)->towns)
 			if (t->subID == 5 && vstd::contains(t->builtBuildings, 22))
 				setPortalDwelling(t);//set initial creatures for all portals of summoning