Merge branch 'master' into port-field
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package mindustry.net;
|
||||
|
||||
import arc.Core;
|
||||
import arc.*;
|
||||
import arc.util.*;
|
||||
import arc.util.io.*;
|
||||
import mindustry.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.io.*;
|
||||
@@ -22,6 +24,18 @@ public class NetworkIO{
|
||||
public static void writeWorld(Player player, OutputStream os){
|
||||
|
||||
try(DataOutputStream stream = new DataOutputStream(os)){
|
||||
//write all researched content to rules if hosting
|
||||
if(state.isCampaign()){
|
||||
state.rules.researched.clear();
|
||||
for(ContentType type : ContentType.all){
|
||||
for(Content c : content.getBy(type)){
|
||||
if(c instanceof UnlockableContent u && u.unlocked() && TechTree.get(u) != null){
|
||||
state.rules.researched.add(u.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stream.writeUTF(JsonIO.write(state.rules));
|
||||
SaveIO.getSaveWriter().writeStringMap(stream, state.map.tags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user