Fix bug with returning enemy fleet being visible to victim
This commit is contained in:
		
							parent
							
								
									3ccb0f1945
								
							
						
					
					
						commit
						f9c5506267
					
				| 
						 | 
				
			
			@ -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);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue