1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Callback jugglery, part 1.

Fixed #252.
This commit is contained in:
Michał W. Urbańczyk
2011-05-03 03:14:18 +00:00
parent aca90abd38
commit b4144dc616
24 changed files with 1218 additions and 1216 deletions

View File

@@ -581,7 +581,7 @@ Uint8 CSpellWindow::pagesWithinCurrentTab()
void CSpellWindow::teleportTo( int town, const CGHeroInstance * hero )
{
const CGTownInstance * dest = LOCPLINT->cb->getTownInfo(town, 1);
const CGTownInstance * dest = LOCPLINT->cb->getTown(town);
LOCPLINT->cb->castSpell(hero, Spells::TOWN_PORTAL, dest->visitablePos());
}
@@ -718,7 +718,7 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
double dist = -1;
for (int g=0; g<Towns.size(); ++g)
{
const CGTownInstance * dest = LOCPLINT->cb->getTownInfo(Towns[g]->id, 1);
const CGTownInstance * dest = LOCPLINT->cb->getTown(Towns[g]->id);
double curDist = dest->pos.dist2d(h->pos);
if (nearest == -1 || curDist < dist)
{
@@ -730,7 +730,7 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[123]);
else
{
const CGTownInstance * town = LOCPLINT->cb->getTownInfo(Towns[nearest]->id, 1);
const CGTownInstance * town = LOCPLINT->cb->getTown(Towns[nearest]->id);
LOCPLINT->cb->castSpell(h, spell, town->visitablePos());// - town->getVisitableOffset());
}
}