mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-25 04:15:14 -06:00
Final touches
This commit is contained in:
parent
6e77e0cb60
commit
0228ddfa46
2 changed files with 7 additions and 1 deletions
|
|
@ -369,7 +369,7 @@ class ScriptAPI(private val bot: Player) {
|
|||
val norm = vec.normalized()
|
||||
val tiles = kotlin.math.min(kotlin.math.floor(vec.magnitude()).toInt(), ServerConstants.MAX_PATHFIND_DISTANCE - 1)
|
||||
val loc = bot.location.transform(norm * tiles)
|
||||
Pathfinder.find(bot, loc).walk(bot)
|
||||
bot.pulseManager.run(object : MovementPulse(bot, loc) { override fun pulse() : Boolean { return true } })
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ public abstract class MovementPulse extends Pulse {
|
|||
|
||||
private Function2<Entity,Node,Location> overrideMethod;
|
||||
|
||||
private Location previousLoc;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code MovementPulse} {@code Object}.
|
||||
*
|
||||
|
|
@ -265,6 +267,9 @@ public abstract class MovementPulse extends Pulse {
|
|||
}
|
||||
}
|
||||
|
||||
if (loc == previousLoc)
|
||||
return;
|
||||
|
||||
if (destination == null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -330,6 +335,7 @@ public abstract class MovementPulse extends Pulse {
|
|||
}
|
||||
}
|
||||
}
|
||||
previousLoc = loc;
|
||||
}
|
||||
last = destination.getLocation();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue