mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-14 18:39:27 -05:00
safe_move!
This commit is contained in:
+5
-2
@@ -530,6 +530,9 @@ function smart_move(destination,on_done) // despite the name, smart_move isn't v
|
|||||||
}
|
}
|
||||||
else if(destination.to=="upgrade" || destination.to=="compound") smart.map="main",smart.x=-204,smart.y=-129;
|
else if(destination.to=="upgrade" || destination.to=="compound") smart.map="main",smart.x=-204,smart.y=-129;
|
||||||
else if(destination.to=="exchange") smart.map="main",smart.x=-26,smart.y=-432;
|
else if(destination.to=="exchange") smart.map="main",smart.x=-26,smart.y=-432;
|
||||||
|
else if(destination.to=="potions" && character.map=="halloween") smart.map="main",smart.x=149,smart.y=-182;
|
||||||
|
else if(destination.to=="potions" && in_arr(character.map,["winterland","winter_inn","winter_cave"])) smart.map="winter_inn",smart.x=160,smart.y=-173;
|
||||||
|
else if(destination.to=="potions") smart.map="main",smart.x=56,smart.y=-122;
|
||||||
}
|
}
|
||||||
if(!smart.map)
|
if(!smart.map)
|
||||||
{
|
{
|
||||||
@@ -632,8 +635,8 @@ function bfs()
|
|||||||
if(result===null)
|
if(result===null)
|
||||||
{
|
{
|
||||||
game_log("Path not found!","#CF575F");
|
game_log("Path not found!","#CF575F");
|
||||||
smart.on_done(false);
|
|
||||||
smart.moving=false;
|
smart.moving=false;
|
||||||
|
smart.on_done(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -681,8 +684,8 @@ function smart_move_logic()
|
|||||||
{
|
{
|
||||||
if(!smart.plot.length)
|
if(!smart.plot.length)
|
||||||
{
|
{
|
||||||
smart.on_done(true);
|
|
||||||
smart.moving=false;
|
smart.moving=false;
|
||||||
|
smart.on_done(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var current=smart.plot[0];
|
var current=smart.plot[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user