Browse Source

bug[#1597]: Projectiles with positional targets now render correctly

tags/v0.8.1^2
Shaun 3 years ago
parent
commit
a9e1da7db4
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      src/client/js/components/projectile.js
  2. +2
    -2
      src/server/world/randomMap/randomMap.js

+ 2
- 2
src/client/js/components/projectile.js View File

@@ -88,8 +88,8 @@ define([
let target = this.target;

//Cater for offset (which isn't tile based yet)
const tx = target.x + (target.offsetX / scale);
const ty = target.y + (target.offsetY / scale);
const tx = target.x + ((target.offsetX || 0) / scale);
const ty = target.y + ((target.offsetY || 0) / scale);

let dx = tx - this.x;
let dy = ty - this.y;


+ 2
- 2
src/server/world/randomMap/randomMap.js View File

@@ -67,14 +67,14 @@ module.exports = {
this.offsetRooms(startRoom);
buildMap(this, instance, startRoom);

return true;

//To spawn in another room
/*const spawnRoom = this.rooms.find(t => t.template.properties.end);
map.spawn = [{
x: spawnRoom.x + ~~(spawnRoom.template.width / 2) - 2,
y: spawnRoom.y + ~~(spawnRoom.template.height / 2) + 6
}];*/

return true;
},

loadMapProperties: function ({ leafConstraints, endConstraints }) {


Loading…
Cancel
Save