Browse Source

Merge branch 'master' of gitlab.com:Isleward/isleward

tags/v0.13.0^2
Shaun 6 months ago
parent
commit
2453035e25
3 changed files with 18 additions and 2 deletions
  1. +3
    -0
      src/server/components/aggro.js
  2. +4
    -1
      src/server/components/social/teleport.js
  3. +11
    -1
      src/server/world/atlas.js

+ 3
- 0
src/server/components/aggro.js View File

@@ -29,6 +29,9 @@ module.exports = {
if (blueprint.faction)
this.faction = blueprint.faction;

if (blueprint.range)
this.range = blueprint.range;

//TODO: Why don't we move if faction is null?
if (!this.has('faction'))
return;


+ 4
- 1
src/server/components/social/teleport.js View File

@@ -2,7 +2,10 @@ module.exports = async (cpnSocial, targetName) => {
const { obj } = cpnSocial;
const { instance: { objects, physics }, syncer } = obj;

const target = objects.find(o => o.name && o.name.toLowerCase().includes(targetName.toLowerCase()));
if (typeof(targetName) !== 'string')
return;

const target = objects.find(o => o.name?.toLowerCase().includes(targetName.toLowerCase()));

if (!target)
return;


+ 11
- 1
src/server/world/atlas.js View File

@@ -24,7 +24,17 @@ module.exports = {

const partyIds = obj.components.find(c => c.type === 'social')?.party;
if (partyIds) {
const partyLeader = cons.players.find(p => partyIds.includes(p.id) && p.components.find(c => c.type === 'social')?.isPartyLeader);
const partyLeader = cons.players.find(p => {
if (!partyIds.includes(p.id))
return false;

const cpnSocial = p.components.find(c => c.type === 'social');

if (!cpnSocial)
return false;

return cpnSocial.isPartyLeader;
});

if (partyLeader?.zoneName === zoneName)
zoneId = partyLeader.zoneId;


Loading…
Cancel
Save