Fix location share
This commit is contained in:
parent
5f45b3b4dc
commit
950afd5d10
2 changed files with 3 additions and 5 deletions
|
|
@ -62,8 +62,8 @@ const existsEntity = (name: string): boolean => {
|
||||||
return existsPlayer(name) || existsNpc(name);
|
return existsPlayer(name) || existsNpc(name);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPlayer = (id: string): IPlayer => {
|
const getPlayer = (userId: string): IPlayer => {
|
||||||
return getPlayerByName(getUserNameById(id));
|
return getPlayerByName(getUserNameById(userId));
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPlayerByName = (name: string): IPlayer => {
|
const getPlayerByName = (name: string): IPlayer => {
|
||||||
|
|
@ -80,7 +80,7 @@ const getPlayerByName = (name: string): IPlayer => {
|
||||||
|
|
||||||
const getEntityByName = (name: string): IPlayer | TFullNPC => {
|
const getEntityByName = (name: string): IPlayer | TFullNPC => {
|
||||||
if (existsPlayer(name)) {
|
if (existsPlayer(name)) {
|
||||||
return getPlayer(name);
|
return getPlayerByName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const npc = getNpcByName(name);
|
const npc = getNpcByName(name);
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,6 @@ const hasLocation = (
|
||||||
const entitiesShareLocation = (entityA: IEntity, entityB: IEntity): boolean => {
|
const entitiesShareLocation = (entityA: IEntity, entityB: IEntity): boolean => {
|
||||||
const locationA = getLocation(entityA.location);
|
const locationA = getLocation(entityA.location);
|
||||||
const locationB = getLocation(entityB.location);
|
const locationB = getLocation(entityB.location);
|
||||||
console.log(locationA.id);
|
|
||||||
console.log(locationB.id);
|
|
||||||
|
|
||||||
return locationA.id === locationB.id;
|
return locationA.id === locationB.id;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue