Skip to content

Commit

Permalink
fix: Member OBJs only spawn in member worlds. (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlenarnTemp authored Mar 1, 2024
1 parent 2dad409 commit b733aab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lostcity/engine/GameMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ZoneManager from '#lostcity/engine/zone/ZoneManager.js';
import Npc from '#lostcity/entity/Npc.js';
import Obj from '#lostcity/entity/Obj.js';
import World from '#lostcity/engine/World.js';
import ObjType from '#lostcity/cache/ObjType.js';

export default class GameMap {
readonly collisionManager = new CollisionManager();
Expand Down Expand Up @@ -67,7 +68,12 @@ export default class GameMap {

const obj = new Obj(level, mapsquareX + localX, mapsquareZ + localZ, objId, objCount);

this.zoneManager.getZone(obj.x, obj.z, obj.level).addStaticObj(obj);
const objType = ObjType.get(objId);
if (objType.members === true && World.members === true) {
this.zoneManager.getZone(obj.x, obj.z, obj.level).addStaticObj(obj);
} else if (objType.members === false) {
this.zoneManager.getZone(obj.x, obj.z, obj.level).addStaticObj(obj);
}
}
}
}
Expand Down

0 comments on commit b733aab

Please sign in to comment.