Skip to content

Commit

Permalink
Fix minor crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
izb committed May 21, 2013
1 parent 075edc0 commit b538080
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
17 changes: 12 additions & 5 deletions dist/snaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -3138,13 +3138,16 @@ define('plugins/sprite/flock',[],function() {
* TODO: Should phasing alter weights?
*/

var weightSeparation = 2;
var weightSeparation = 2.5;
var weightAlignment = 1;
var weightCohesion = 1.8;
var weightSteering = 0.5;
var weightSteering = 0.9;
var weightInertia =1.5;
var hweightInertia =weightInertia/2;

/* TODO: I have a vague suspicion that not all the vertical components are being
* halved correctly. */

/* steering */

this.flock_steering(s, this.xy);
Expand Down Expand Up @@ -5327,11 +5330,11 @@ define('ai/pathfinder',[],function() {
* the offset jumps in the original orthogonally arranged tile data looks peculiar and
* differs on odd and even rows. Trust me though, these values check out fine. */

/* E SE S SW W NW N NE E S W N */
/* E SE S SW W NW N NE : E S W N */
this.xdirectionsOdd = diagonals?[1, 1, 0, 0, -1, 0, 0, 1]:[1, 0, -1, 0]; /* TODO: On an isometric map, n,s,e,w are not diagonal in screen-space */
this.ydirectionsOdd = diagonals?[0, 1, 2, 1, 0, -1, -2, -1]:[0, 2, 0, -2];

/* E SE S SW W NW N NE E S W N */
/* E SE S SW W NW N NE : E S W N */
this.xdirectionsEven = diagonals?[1, 0, 0, -1, -1, -1, 0, 0]:[1, 0, -1, 0];
this.ydirectionsEven = diagonals?[0, 1, 2, 1, 0, -1, -2, -1]:[0, 2, 0, -2];

Expand Down Expand Up @@ -5698,6 +5701,10 @@ define('ai/pathfinder',[],function() {
this.nodeRows[i].length = 0;
}
var n = this.node(x0,y0);
if (n===null) {
/* This means the first square was solid. Call off the search. */
return [];
}
n.open = true;
this.scoreHeap.clear().push(n);
n.fscore = distance2(x0,y0,x1,y1);
Expand Down Expand Up @@ -5942,7 +5949,7 @@ function(SpriteDef, Sprite, Composite, Keyboard, Mouse, util, StaggeredIsometric
/* If regions is true, then the x,y is shown for tiles. If it's a comma-separated list
* then those property values are shown on each tile. */
this.dbgShowRegions = !!settings.showRegions;
this.dbgRegionProps = settings.showRegions!==undefined&&settings.showRegions.length>0&&settings.showRegions!=='true'?
this.dbgRegionProps = settings.showRegions&&settings.showRegions.length>0&&settings.showRegions!=='true'?
settings.showRegions.split(','):[];

this.imageCache = {};
Expand Down
20 changes: 10 additions & 10 deletions dist/snaps.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b538080

Please sign in to comment.