Fix bug with returning enemy fleet being visible to victim

This commit is contained in:
Aelita4 2025-02-10 20:45:12 +01:00
parent 3ccb0f1945
commit f9c5506267
Signed by: Aelita4
GPG Key ID: E44490C2025906C1
1 changed files with 10 additions and 2 deletions

View File

@ -14,7 +14,15 @@ let own = 0;
let friendly = 0;
let enemy = 0;
for(const f of fleet) {
const filteredFleet = fleet.filter(f => {
const source = locationManager.findId(f.source);
if(source !== null) {
if(source instanceof SystemManager) return source.data.ownedBy.id.equals(userId)
else return source.system.data.ownedBy.id.equals(userId);
} else return false;
})
for(const f of filteredFleet) {
const source = locationManager.findId(f.source);
if(source !== null) {
if(source instanceof SystemManager) {
@ -35,7 +43,7 @@ for(const f of fleet) {
---
<div id="fleet-status">
<table id="fleet-list">
{fleet.map(f => {
{filteredFleet.map(f => {
const source = locationManager.findId(f.source);
const destination = locationManager.findId(f.destination);